Index: trunk/ppImage/src/ppImageDetrendReadout.c
===================================================================
--- trunk/ppImage/src/ppImageDetrendReadout.c	(revision 29926)
+++ trunk/ppImage/src/ppImageDetrendReadout.c	(revision 33590)
@@ -110,4 +110,6 @@
             // offset information, we are not really getting exactly the right mapping from the
             // original file.
+	    // CZW 2012-03-21: I do not believe this is true anymore.  In any case, this seems to be what
+	    //                 ppImageReplaceBackground does to do sky subtraction.
             psImageBinning *binning = psImageBinningAlloc();
             binning->nXruff = noiseMap->image->numCols;
@@ -119,4 +121,39 @@
             psImageUnbin (noiseImage, noiseMap->image, binning);
             psFree (binning);
+	    // Stolen from pmSkySubtract.c
+	    // CZW: Unneeded, as psImageUnbin does the bilinear interpolation?  It still looks blocky. 
+/* 	    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, RECIPE_NAME); // Recipe */
+/* 	    psAssert(recipe, "Should be there!"); */
+
+/* 	    psS32 xBinFactor = psMetadataLookupS32(NULL,recipe,"NOISE.XBIN"); */
+/* 	    psS32 yBinFactor = psMetadataLookupS32(NULL,recipe,"NOISE.YBIN"); */
+/* 	    psImageInterpolateOptions *interp = psImageInterpolateOptionsAlloc(PS_INTERPOLATE_BILINEAR, */
+/* 									       noiseMap->image, */
+/* 									       NULL, NULL, */
+/* 									       0, 0.0, 0.0, 0, 0, 0.0); */
+/* 	    for (psS32 row = 0; row < input->image->numRows; row++) { */
+/* 	      for (psS32 col = 0; col < input->image->numCols; col++) { */
+/* 		// We calculate the F32 value of the pixel coordinates in the */
+/* 		// binned image and then use a pixel interpolation routine to */
+/* 		// determine the value of the pixel at that location. */
+/* 		psF32 binRowF64 = ((psF32) row) / ((psF32) yBinFactor); */
+/* 		psF32 binColF64 = ((psF32) col) / ((psF32) xBinFactor); */
+/* 		// We add 0.5 to the pixel locations since the pixel */
+/* 		// interpolation routine defines the location of pixel */
+/* 		// (i, j) as (i+0.5, j+0.5). */
+/* 		binRowF64+= 0.5; */
+/* 		binColF64+= 0.5; */
+
+/* 		double binPixel; */
+/* 		if (!psImagePixelInterpolate(&binPixel, NULL, NULL, binColF64, binRowF64, interp)) { */
+/* 		  psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image."); */
+/* 		  psFree(interp); */
+/* 		  psFree(noiseImage); */
+/* 		  return NULL; */
+/* 		} */
+/* 		noiseImage->data.F32[row][col] = binPixel; */
+/* 	      } */
+/* 	    } */
+/* 	    psFree(interp); */
         }
 
