IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36710


Ignore:
Timestamp:
Apr 30, 2014, 7:04:03 PM (12 years ago)
Author:
mhuber
Message:

adding option for minimum inputs per pixel in stack, default is 1

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippconfig/gpc1/ppStack.config

    r36659 r36710  
    167167    PSF.TARGET.AS.MAX  BOOL  TRUE
    168168    PSF.TARGET.AS.MAX.EPSILON F32 0.1
    169     THRESHOLD.MASK  F32     0.01             # Threshold for mask deconvolution (0..1)
     169    THRESHOLD.MASK  F32     0.3             # Threshold for mask deconvolution (0..1)
    170170    COMBINE.ITER    F32     0.5             # Number of rejection iterations per input
    171     COMBINE.REJ     F32     2.5             # Rejection threshold in combination (sigma)
     171    COMBINE.REJ     F32     3.5             # Rejection threshold in combination (sigma)
    172172    COMBINE.SYS     F32     0.1             # Relative systematic error in combination
    173173    COMBINE.DISCARD F32     0.2             # Discard fraction for Olympic weighted mean
    174174    IMAGE.REJ       F32     0.1             # Rejected pixel fraction threshold for rejecting entire image
     175    NMINPIX         S32     10              # Minimum input per pixel -- testing
     176    MASK.VAL        STR     SUSPECT,MASK.VALUE,CONV.BAD,GHOST # Mask value of input bad pixels
    175177END
    176178
  • trunk/ippconfig/recipes/ppStack.config

    r36659 r36710  
    3232TARGET.FRAC     F32     0.1             # Minimum flux fraction for target PSF
    3333TARGET.MINMAG   F32     3.0             # Minimum magnitude difference to tolerate in stamp
     34NMINPIX         S32     1               # Minimum input per pixel -- testing
    3435
    3536BACKGROUND.MODEL    BOOL   FALSE        # Construct a stacked version of the warp stage background
  • trunk/ppStack/src/ppStackReadout.c

    r36610 r36710  
    116116    bool useVariance = psMetadataLookupBool(&mdok, recipe, "VARIANCE"); // Use variance for rejection?
    117117    bool safe = psMetadataLookupBool(&mdok, recipe, "SAFE"); // Be safe when combining small numbers of pixels
     118   
     119    int nminpix = psMetadataLookupS32(&mdok, recipe, "NMINPIX"); // Minimum input per pixel to combine with
    118120
    119121    psMetadata *ppsub = psMetadataLookupMetadata(NULL, config->recipes, "PPSUB"); // PPSUB recipe
     
    161163
    162164    if (!pmStackCombine(outRO, NULL, stack, maskBad, maskSuspect, maskBlank, kernelSize, iter,
    163                         combineRej, combineSys, combineDiscard, useVariance, safe, false)) {
     165                        combineRej, combineSys, combineDiscard, useVariance, safe, nminpix, false)) {
    164166        psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts with rejection.");
    165167        psFree(stack);
     
    218220    bool useVariance = psMetadataLookupBool(&mdok, recipe, "VARIANCE"); // Use variance for rejection?
    219221    bool safe = psMetadataLookupBool(&mdok, recipe, "SAFE"); // Be safe when combining small numbers of pixels
     222
     223    int nminpix = psMetadataLookupS32(&mdok, recipe, "NMINPIX"); // Minimum input per pixel to combine with
    220224
    221225    psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.VAL"); // Name of bits to mask for bad
     
    275279
    276280    if (!pmStackCombine(outRO, expRO, stack, maskBad, maskSuspect, maskBlank, 0, iter, combineRej,
    277                         combineSys, combineDiscard, useVariance, safe, rejected)) {
     281                        combineSys, combineDiscard, useVariance, safe, nminpix, rejected)) {
    278282        psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts.");
    279283        psFree(stack);
  • trunk/psModules/src/imcombine/pmStack.c

    r36651 r36710  
    835835                          psImageMaskType goodMask, // Value for good pixels
    836836                          bool safe,           // Safe combination?
     837                          int nminpix,         // Minimum number of input per pixel
    837838                          float invTotalWeight    // Inverse of total weight for all inputs
    838839                          )
     
    854855    CHECKPIX(x, y, "bad vs good : %x %x %x\n", maskValue, badMask, blankMask);
    855856
    856     switch (num) {
     857    //MEH -- hackish adding of lower limit for input per pixel
     858    int numN = num;
     859    if (num < nminpix) {
     860        CHECKPIX(x, y, "Nmin (%d) inputs (%d) to combine, pixel %d,%d is manually set bad\n", nminpix, numN, x, y);
     861        numN = 0;
     862    }
     863    switch (numN) {
    857864      case 0: {
    858865          // Nothing to combine: it's bad
     
    15181525    bool useVariance,
    15191526    bool safe,
     1527    int nminpix,
    15201528    bool rejection)
    15211529{
     
    16921700            psImageMaskType goodMask = 0; // OR of mask bits in all good input pixels
    16931701            combineExtract(&num, &suspect, &badMask, &goodMask, buffer, combinedImage, combinedMask, combinedVariance, input, weights, exps, addVariance, reject, x, y, badMaskBits, suspectMaskBits);
    1694             combinePixels(combinedImage, combinedMask, combinedVariance, exp, expnum, expweight, num, buffer, x, y, blankMaskBits, badMask, goodMask, safe, totalExpWeight);
     1702            combinePixels(combinedImage, combinedMask, combinedVariance, exp, expnum, expweight, num, buffer, x, y, blankMaskBits, badMask, goodMask, safe, nminpix, totalExpWeight);
    16951703
    16961704            if (iter > 0) {
  • trunk/psModules/src/imcombine/pmStack.h

    r34842 r36710  
    6161                    bool useVariance,   ///< Use variance values for rejection?
    6262                    bool safe,          ///< Play safe with small numbers of input pixels (mask if N <= 2)?
     63                    int nminpix,        ///< Minimum number input per pixel to combine
    6364                    bool rejectInspect  ///< Reject pixels instead of marking them for inspection?
    6465    );
Note: See TracChangeset for help on using the changeset viewer.