IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 22, 2021, 5:45:06 AM (5 years ago)
Author:
eugene
Message:

adding masking to stack-by-percent

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-dev-20210817/psModules/src/imcombine/pmStack.c

    r41843 r41852  
    756756        // *goodMask &= mask->data.PS_TYPE_IMAGE_MASK_DATA[yIn][xIn]; // save the mask bits still used
    757757        // check for set bits and increment counter as appropriate
     758        // count the number of times a given mask bit is set in the input pixels.
     759        // NOTE: since we have explicitly skipped the pixels with any bad bits, these are only
     760        // the suspect bits (nGoodBits is a bit of a misnomer: it is more like 'nSuspectBitsForGoodInputs'
    758761        {
    759762            psImageMaskType value = 0x0001;
     
    15501553                pmReadout *ro = data->readout;  // Readout of interest
    15511554                psImage *image = ro->image;
     1555                psImage *mask = ro->mask;
    15521556
    15531557                int xIn = x - data->readout->col0;
     
    15571561                if (fabs(image->data.F32[yIn][xIn]) > 1e5) continue;
    15581562                // XXX need to test the input mask as well here
     1563                if (mask->data.PS_TYPE_IMAGE_MASK_DATA[yIn][xIn] & badMaskBits);
     1564
     1565                // XXX save the count of suspect bits
     1566
     1567# if (0)
     1568                // count the number of times a given mask bit is set in the input pixels.
     1569                // NOTE: since we have explicitly skipped the pixels with any bad bits, these are only
     1570                // the suspect bits (nGoodBits is a bit of a misnomer: it is more like 'nSuspectBitsForGoodInputs'
     1571                if (1) {
     1572                  psImageMaskType value = 0x0001;
     1573                  for (int nbit = 0; nbit < 16; nbit ++) {
     1574                    if (mask->data.PS_TYPE_IMAGE_MASK_DATA[yIn][xIn] & value) {
     1575                      // XXX nGoodBits[nbit] ++;
     1576                    }
     1577                    value <<= 1;
     1578                  }
     1579                }
     1580# endif
    15591581
    15601582                pixelData->data.F32[nGood] = image->data.F32[yIn][xIn];
     
    15711593            }
    15721594
     1595# if (0)
     1596# define SUSPECT_FRACTION 0.65
     1597            // set the mask bits if nGoodBits[i] > f*numGood
     1598            if (0) {
     1599              psImageMaskType value = 0x0001;
     1600              for (int nbit = 0; nbit < 16; nbit ++) {
     1601                if (nGoodBits[nbit] > SUSPECT_FRACTION*numGood) {
     1602                  *goodMask |= value;
     1603                }
     1604                value <<= 1;
     1605              }
     1606            }
     1607# endif
     1608
    15731609            int Ns = MIN(MAX(0, minRange * nGood),nGood); // e.g., 0.1 * 50 = 5
    15741610            int Ne = MIN(MAX(0, maxRange * nGood),nGood); // e.g., 0.9 * 50 = 45
     
    15871623            // variance on the mean (stdev / sqrt(N))^2
    15881624            float varValue = varSum / (Npt - 1) / Npt;
     1625
     1626            // XXX this is probably not the correct variance to save
     1627            // the predicted variance should be the 1 / sum (1/var)
    15891628
    15901629            combined->image->data.F32[y][x] = mean;
Note: See TracChangeset for help on using the changeset viewer.