IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 2, 2009, 11:55:52 AM (17 years ago)
Author:
Paul Price
Message:

Removing warpSkyfile.ignored from database, in favour of using the quality flags. This means that we can ignore skycells on the basis of usefulness (whether we can measure the PSF) rather than an arbitrary cut of 10% lit pixels (which pixels may or may not be useful).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap/pswarp/src/pswarpPixelFraction.c

    r21323 r23677  
    3434    PS_ASSERT_IMAGE_TYPE(readout->mask, PS_TYPE_IMAGE_MASK, false);
    3535
    36     if (stats) {
    37         PS_ASSERT_METADATA_NON_NULL(stats, false);
     36    if (!stats) {
     37        // No point in continuing --- we record results to the statistics
     38        return true;
    3839    }
    3940    PS_ASSERT_PTR_NON_NULL(config, false);
    4041    PS_ASSERT_METADATA_NON_NULL(config->arguments, false);
    4142
    42     bool status;
    43 
    44     float minFrac = psMetadataLookupF32(NULL, config->arguments, "ACCEPT.FRAC"); ///< Minimum fraction
     43    bool status;
    4544
    4645    // load the recipe
     
    5251
    5352    // output mask bits
    54     psImageMaskType maskValue = psMetadataLookupImageMask(&status, recipe, "MASK.OUTPUT"); 
     53    psImageMaskType maskValue = psMetadataLookupImageMask(&status, recipe, "MASK.OUTPUT");
    5554    psAssert (status, "MASK.OUTPUT was not defined");
    5655
     
    5958
    6059    int numCols = image->numCols, numRows = image->numRows; ///< Size of image
    61     long numPix = numCols * numRows;
    6260
    6361    // Range of valid pixels
    6462    int xMin = INT_MAX, xMax = -INT_MAX, yMin = INT_MAX, yMax = -INT_MAX;
    6563
    66     long numBad = 0;                     ///< Number of bad pixels
     64    long numGood = 0;                   ///< Number of bad pixels
    6765    for (int y = 0; y < numRows; y++) {
    6866        for (int x = 0; x < numCols; x++) {
    69             if (mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskValue) {
    70                 numBad++;
    71             } else {
     67            if (!(mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskValue))
    7268                if (y > yMax) {
    7369                    yMax = y;
     
    8682    }
    8783
    88     float goodFrac = (numPix - numBad) / (float)numPix; ///< Fraction of good pixels
    89     bool accept = (goodFrac >= minFrac ? true : false); ///< Accept this readout?
    90 
    9184    if (stats) {
    92         psMetadataAddBool(stats, PS_LIST_HEAD, "ACCEPT", 0, "Accept this readout?", accept);
    93 
    9485        psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.XMIN", 0, "Minimum valid x value", xMin);
    9586        psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.XMAX", 0, "Maximum valid x value", xMax);
     
    9889    }
    9990
    100     return accept;
     91    return true;
    10192}
    10293
Note: See TracChangeset for help on using the changeset viewer.