IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 18, 2009, 10:42:06 AM (17 years ago)
Author:
eugene
Message:

adding noise map to variance generation; adding options to supply the noiseMap

File:
1 edited

Legend:

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

    r24079 r24485  
    6464    if (options->doVarianceBuild) {
    6565        // create the target mask and variance images
    66         pmReadoutGenerateVariance(input, true);
     66        psImage *noiseImage = NULL;
     67        if (options->doNoiseMap) {
     68            // XXX convert the noiseMap image to a binned image
     69            pmReadout *noiseMap = NULL;
     70            noiseMap = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.NOISEMAP");
     71            noiseImage = psImageCopy (NULL, input->image, PS_TYPE_F32);
     72            psImageInit (noiseImage, 0.0);
     73
     74            // XXX this works, but is not really quite right: the model shoud include the
     75            // offset information, we are not really getting exactly the right mapping from the
     76            // original file.
     77            psImageBinning *binning = psImageBinningAlloc();
     78            binning->nXruff = noiseMap->image->numCols;
     79            binning->nYruff = noiseMap->image->numRows;
     80            binning->nXfine = input->image->numCols;
     81            binning->nYfine = input->image->numRows;
     82            psImageBinningSetScale(binning, PS_IMAGE_BINNING_LEFT);
     83
     84            psImageUnbin (noiseImage, noiseMap->image, binning);
     85            psFree (binning);
     86        }
     87        pmReadoutGenerateVariance(input, noiseImage, true);
     88        psFree (noiseImage);
    6789    }
    6890
Note: See TracChangeset for help on using the changeset viewer.