IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 3, 2023, 2:51:47 PM (3 years ago)
Author:
eugene
Message:

pmStackCombineByPercentile option to set nminpix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmStack.c

    r42091 r42555  
    15481548  } continue; }
    15491549
     1550// combine pixels, averaging the inner XX percentile range, after rejecting 5-sigma outliers (robust 5 sigma)
    15501551bool pmStackCombineByPercentile(
    15511552    pmReadout *combined,                // output stacked readout
     
    15531554    psArray *stackData,                 // input exposures
    15541555    psF64 rejectFraction,               // outlier fraction of pixels to reject
     1556    int nminpix,                        // minimum number of input values required to generate an output value
    15551557    psImageMaskType badMaskBits,        // treat these bits as 'bad'
    15561558    psImageMaskType suspectMaskBits,    // treat these bits as 'suspect'
    15571559    psImageMaskType blankMaskBits       // use this mask value for pixels missing input data (distinguish between Ninput = 0 and Ngood = 0?)
    1558     ) {
     1560                                ) {
    15591561    int minInputCols, maxInputCols, minInputRows, maxInputRows; // Smallest and largest values to combine
    15601562    int xSize, ySize;                   // Size of the output image
     
    16401642                nGood ++;
    16411643            }
    1642 # define MIN_GOOD_PERCENTILE 3
    1643 
    1644             if (nGood < MIN_GOOD_PERCENTILE) ESCAPE;
     1644
     1645            if (nGood < nminpix) ESCAPE;
    16451646           
    16461647            pixelData->n = nGood;
     
    16771678            int nGoodClip = Nhi - Nlo;
    16781679
    1679             int isTest = false;
     1680            int isTest = true;
    16801681            isTest = isTest || ((x == 4743) && (y == 2903));
    16811682            isTest = isTest || ((x == 4953) && (y == 2919));
     
    17021703            // 'AT_LEAST' means we reject at least 'rejectFraction' of values, but it could
    17031704            // be a higher percentage for smaller numbers of inputs.
    1704 # define AT_LEAST 1
    1705 # define MIN_GOOD_PERCENTILE 3
     1705# define AT_LEAST 0
     1706
    17061707# if (AT_LEAST)
    17071708            int Ns = MIN(MAX(1, 0.5*rejectFraction * nGoodClip), nGoodClip) + Nlo;
     
    17131714            int Npt = Ne - Ns;
    17141715# endif
    1715             if ((Npt < 1) || (nGood < MIN_GOOD_PERCENTILE)) ESCAPE;
     1716            if ((Npt < 1) || (nGood < nminpix)) ESCAPE;
    17161717
    17171718            // Set the given (suspect) mask bit if nGoodBits[i] > f*nGood in other words
Note: See TracChangeset for help on using the changeset viewer.