IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 21, 2012, 5:02:21 PM (14 years ago)
Author:
watersc1
Message:

Tell ppImage how to construct a noise map, and add appropriate recipes for this.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImageDetrendReadout.c

    r29926 r33590  
    110110            // offset information, we are not really getting exactly the right mapping from the
    111111            // original file.
     112            // CZW 2012-03-21: I do not believe this is true anymore.  In any case, this seems to be what
     113            //                 ppImageReplaceBackground does to do sky subtraction.
    112114            psImageBinning *binning = psImageBinningAlloc();
    113115            binning->nXruff = noiseMap->image->numCols;
     
    119121            psImageUnbin (noiseImage, noiseMap->image, binning);
    120122            psFree (binning);
     123            // Stolen from pmSkySubtract.c
     124            // CZW: Unneeded, as psImageUnbin does the bilinear interpolation?  It still looks blocky.
     125/*          psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, RECIPE_NAME); // Recipe */
     126/*          psAssert(recipe, "Should be there!"); */
     127
     128/*          psS32 xBinFactor = psMetadataLookupS32(NULL,recipe,"NOISE.XBIN"); */
     129/*          psS32 yBinFactor = psMetadataLookupS32(NULL,recipe,"NOISE.YBIN"); */
     130/*          psImageInterpolateOptions *interp = psImageInterpolateOptionsAlloc(PS_INTERPOLATE_BILINEAR, */
     131/*                                                                             noiseMap->image, */
     132/*                                                                             NULL, NULL, */
     133/*                                                                             0, 0.0, 0.0, 0, 0, 0.0); */
     134/*          for (psS32 row = 0; row < input->image->numRows; row++) { */
     135/*            for (psS32 col = 0; col < input->image->numCols; col++) { */
     136/*              // We calculate the F32 value of the pixel coordinates in the */
     137/*              // binned image and then use a pixel interpolation routine to */
     138/*              // determine the value of the pixel at that location. */
     139/*              psF32 binRowF64 = ((psF32) row) / ((psF32) yBinFactor); */
     140/*              psF32 binColF64 = ((psF32) col) / ((psF32) xBinFactor); */
     141/*              // We add 0.5 to the pixel locations since the pixel */
     142/*              // interpolation routine defines the location of pixel */
     143/*              // (i, j) as (i+0.5, j+0.5). */
     144/*              binRowF64+= 0.5; */
     145/*              binColF64+= 0.5; */
     146
     147/*              double binPixel; */
     148/*              if (!psImagePixelInterpolate(&binPixel, NULL, NULL, binColF64, binRowF64, interp)) { */
     149/*                psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image."); */
     150/*                psFree(interp); */
     151/*                psFree(noiseImage); */
     152/*                return NULL; */
     153/*              } */
     154/*              noiseImage->data.F32[row][col] = binPixel; */
     155/*            } */
     156/*          } */
     157/*          psFree(interp); */
    121158        }
    122159
Note: See TracChangeset for help on using the changeset viewer.