Index: trunk/psphot/src/psphotApResid.c
===================================================================
--- trunk/psphot/src/psphotApResid.c	(revision 20080)
+++ trunk/psphot/src/psphotApResid.c	(revision 20081)
@@ -47,5 +47,4 @@
 
     // this is the smallest radius allowed: need to at least extend growth curve down to this...
-    float PSF_FIT_PAD   = psMetadataLookupF32 (&status, recipe, "PSF_FIT_PADDING");
     bool IGNORE_GROWTH = psMetadataLookupBool (&status, recipe, "IGNORE_GROWTH");
     bool INTERPOLATE_AP = psMetadataLookupBool (&status, recipe, "INTERPOLATE_AP");
@@ -70,14 +69,4 @@
     // set limits on the aperture magnitudes
     pmSourceMagnitudesInit (recipe);
-
-    // measure the aperture loss as a function of radius for PSF
-    float REF_RADIUS = psMetadataLookupF32 (&status, recipe, "PSF_REF_RADIUS");
-    psf->growth = pmGrowthCurveAlloc (PSF_FIT_PAD, 100.0, REF_RADIUS);
-
-    if (!pmGrowthCurveGenerate (readout, psf, IGNORE_GROWTH, maskVal, markVal)) {
-        psError(PSPHOT_ERR_APERTURE, false, "Fitting aperture corrections");
-        psFree(psf->growth); psf->growth = NULL;
-        return false;
-    }
 
     psVector *mask    = psVectorAllocEmpty (300, PS_TYPE_U8);
@@ -210,9 +199,9 @@
     // save results for later output
     psMetadataAdd (recipe, PS_LIST_TAIL, "SKYBIAS",  PS_DATA_F32 | PS_META_REPLACE, "aperture sky bias",   0.0);
-    psMetadataAdd (recipe, PS_LIST_TAIL, "SKYSAT",   PS_DATA_F32 | PS_META_REPLACE, "aperture sky bias",   0.0);
+    psMetadataAdd (recipe, PS_LIST_TAIL, "SKYSAT",   PS_DATA_F32 | PS_META_REPLACE, "aperture-determined saturation",   0.0);
     psMetadataAdd (recipe, PS_LIST_TAIL, "APMIFIT",  PS_DATA_F32 | PS_META_REPLACE, "aperture residual",   psf->ApResid);
     psMetadataAdd (recipe, PS_LIST_TAIL, "DAPMIFIT", PS_DATA_F32 | PS_META_REPLACE, "ap residual scatter", psf->dApResid);
-    psMetadataAdd (recipe, PS_LIST_TAIL, "APLOSS",   PS_DATA_F32 | PS_META_REPLACE, "ap residual scatter", psf->growth->apLoss);
-    psMetadataAdd (recipe, PS_LIST_TAIL, "NAPMIFIT", PS_DATA_S32 | PS_META_REPLACE, "ap residual scatter", psf->nApResid);
+    psMetadataAdd (recipe, PS_LIST_TAIL, "APLOSS",   PS_DATA_F32 | PS_META_REPLACE, "aperture loss (mag)", psf->growth->apLoss);
+    psMetadataAdd (recipe, PS_LIST_TAIL, "NAPMIFIT", PS_DATA_S32 | PS_META_REPLACE, "number of apresid stars", psf->nApResid);
 
     // psLogMsg ("psphot.apresid", PS_LOG_INFO, "measure full-frame aperture residuals for %d of %d objects: %f sec\n", Nkeep, Npsf, psTimerMark ("psphot"));
@@ -327,9 +316,13 @@
 	
     if (readout->image->numCols > readout->image->numRows) {
-	Nx = scale;
-	Ny = PS_MAX (1, Nx * (readout->image->numRows / (float) readout->image->numCols));
+        Nx = scale;
+	float AR = readout->image->numRows / (float) readout->image->numCols;
+	Ny = (int) (Nx * AR + 0.5);
+        Ny = PS_MAX (1, Ny);
     } else {
 	Ny = scale;
-	Nx = PS_MAX (1, Ny * (readout->image->numCols / (float) readout->image->numRows));
+	float AR = readout->image->numRows / (float) readout->image->numCols;
+	Nx = (int) (Ny * AR + 0.5);
+	Nx = PS_MAX (1, Nx);
     }
 
