IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33590 for trunk/ppImage/src


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.

Location:
trunk/ppImage/src
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/Makefile.am

    r30655 r33590  
    5959        ppImageParityFlip.c \
    6060        ppImageCheckCTE.c \
     61        ppImageCheckNoise.c \
    6162        ppImageFileCheck.c \
    6263        ppImageVersion.c \
  • trunk/ppImage/src/ppImage.h

    r33243 r33590  
    4848    bool doStats;                       // call ppStats on the image
    4949    bool checkCTE;                      // measure pixel-based variance
     50    bool checkNoise;                    // measure cell-level variance
    5051    bool applyParity;                   // Apply Cell parities
    5152
     
    172173bool ppImageCheckCTE(pmConfig *config, ppImageOptions *options, pmFPAview *view);
    173174
     175bool ppImageCheckNoise(pmConfig *config, ppImageOptions *options, pmFPAview *view);
     176
    174177bool ppImageBurntoolMask(pmConfig *config, ppImageOptions *options, pmFPAview *view, pmReadout *mask);
    175178
  • 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
  • trunk/ppImage/src/ppImageLoop.c

    r33243 r33590  
    126126                }
    127127
     128                if (!ppImageCheckNoise (config, options, view)) {
     129                    ESCAPE("Unable to generate noisemap");
     130                }
     131               
    128132                // optionally degrade a MD image to 3pi exposure times
    129133                if (!ppImageAddNoise(config, options, view, input->fpa)){
  • trunk/ppImage/src/ppImageOptions.c

    r33243 r33590  
    4141    options->doStats         = false;   // Measure and save image statistics
    4242    options->checkCTE        = false;   // Measure pixel-based variance
     43    options->checkNoise      = false;   // Measure cell-level variances.
    4344    options->applyParity     = false;   // Apply Cell parities
    4445    options->doMaskStats     = false;   // Calculate mask fractions
     
    319320
    320321    options->checkCTE       = psMetadataLookupBool(NULL, recipe, "CHECK.CTE");
     322    options->checkNoise     = psMetadataLookupBool(NULL, recipe, "CHECK.NOISE");
    321323
    322324    /* doMaskBuild : there are some cases where we require a mask, so we force doMaskBuild to be set even if the user specified 'FALSE'
Note: See TracChangeset for help on using the changeset viewer.