Index: trunk/psphot/src/psphotMakeResiduals.c
===================================================================
--- trunk/psphot/src/psphotMakeResiduals.c	(revision 20287)
+++ trunk/psphot/src/psphotMakeResiduals.c	(revision 20307)
@@ -105,6 +105,6 @@
         // we will interpolate the image and weight - include the mask or not?
         // XXX consider better values for the mask bits
-        psImageInterpolateOptions *interp =
-            psImageInterpolateOptionsAlloc(mode, image, weight, NULL, 0xff, 0.0, 0.0, badMask, poorMask, 0.0);
+        psImageInterpolation *interp =
+            psImageInterpolationAlloc(mode, image, weight, NULL, 0xff, 0.0, 0.0, badMask, poorMask, 0.0, 0);
         psArrayAdd (input,  100, interp);
 
@@ -149,10 +149,10 @@
         for (int ox = 0; ox < resid->Ro->numCols; ox++) {
 
-	    int nGoodPixel = 0;              // pixel is off the image
-    
+            int nGoodPixel = 0;              // pixel is off the image
+
             // build the vector of data values for this output pixel
             for (int i = 0; i < input->n; i++) {
 
-                psImageInterpolateOptions *interp = input->data[i];
+                psImageInterpolation *interp = input->data[i];
 
                 // fractional image position
@@ -165,26 +165,26 @@
                     // This pixel is off the image
                     offImage = true;
-		    fmasks->data.U8[i] = 1;
-		    // fprintf (stderr, "off image: %f %f : %f %f\n", ix, iy, flux, dflux);
-                } 
+                    fmasks->data.U8[i] = 1;
+                    // fprintf (stderr, "off image: %f %f : %f %f\n", ix, iy, flux, dflux);
+                }
                 fluxes->data.F32[i] = flux;
                 dfluxes->data.F32[i] = dflux;
                 fmasks->data.U8[i] = mflux;
-		if (isnan(flux)) { 
-		    fmasks->data.U8[i] = 1;
-		}
-		if (fmasks->data.U8[i] == 0) {
-		    nGoodPixel ++;
-		}            
-	    }
-
-	    // skip pixels which are off the image...
-	    bool validPixel = (SPATIAL_ORDER == 0) ? (nGoodPixel > 1) : (nGoodPixel > 3);
+                if (isnan(flux)) {
+                    fmasks->data.U8[i] = 1;
+                }
+                if (fmasks->data.U8[i] == 0) {
+                    nGoodPixel ++;
+                }
+            }
+
+            // skip pixels which are off the image...
+            bool validPixel = (SPATIAL_ORDER == 0) ? (nGoodPixel > 1) : (nGoodPixel > 3);
             if (!validPixel) {
                 resid->Ro->data.F32[oy][ox] = 0.0;
                 resid->Rx->data.F32[oy][ox] = 0.0;
-		resid->Ry->data.F32[oy][ox] = 0.0;
-		resid->mask->data.U8[oy][ox] = 1;
-		continue;
+                resid->Ry->data.F32[oy][ox] = 0.0;
+                resid->mask->data.U8[oy][ox] = 1;
+                continue;
             }
 
@@ -216,7 +216,7 @@
                 //resid->weight->data.F32[oy][ox] = fluxStats->sampleStdev;
 
-		if (resid->Ro->data.F32[oy][ox] < pixelSN*fluxStats->sampleStdev) {
-		  resid->mask->data.U8[oy][ox] = 1;
-		}
+                if (resid->Ro->data.F32[oy][ox] < pixelSN*fluxStats->sampleStdev) {
+                  resid->mask->data.U8[oy][ox] = 1;
+                }
 
             } else {
@@ -254,8 +254,8 @@
                 resid->Ry->data.F32[oy][ox] = B->data.F64[2];
 
-		float dRo = sqrt(A->data.F32[0][0]);
-		if (resid->Ro->data.F32[oy][ox] < pixelSN*dRo) {
-		  resid->mask->data.U8[oy][ox] = 1;
-		}
+                float dRo = sqrt(A->data.F32[0][0]);
+                if (resid->Ro->data.F32[oy][ox] < pixelSN*dRo) {
+                  resid->mask->data.U8[oy][ox] = 1;
+                }
                 //resid->weight->data.F32[oy][ox] = XXX;
             }
