IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15361


Ignore:
Timestamp:
Oct 23, 2007, 11:48:56 AM (19 years ago)
Author:
Paul Price
Message:

Adding more information on stamp rejection to logs.

File:
1 edited

Legend:

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

    r15325 r15361  
    44 *  @author GLG, MHPCC
    55 *
    6  *  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
    7  *  @date $Date: 2007-10-17 02:45:40 $
     6 *  @version $Revision: 1.66 $ $Name: not supported by cvs2svn $
     7 *  @date $Date: 2007-10-23 21:48:56 $
    88 *
    99 *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
     
    947947    }
    948948
     949    if (!isfinite(sigmaRej) || sigmaRej <= 0.0) {
     950        psLogMsg("psModules.imcombine", PS_LOG_INFO, "RMS deviation: %f", sqrt(totalSquareDev / numStamps));
     951        psFree(deviations);
     952        return 0;
     953    }
     954
     955    int numRejected = 0;                // Number of stamps rejected
     956    int numGood = 0;                    // Number of good stamps
     957    double newSquareDev = 0.0;          // New square deviation
     958
    949959    float limit = sigmaRej * sqrt(totalSquareDev / numStamps); // Limit on maximum deviation
    950960    psTrace("psModules.imcombine", 1, "Deviation limit: %f\n", limit);
    951961
    952     int numRejected = 0;
    953962    for (int i = 0; i < stamps->num; i++) {
    954963        pmSubtractionStamp *stamp = stamps->stamps->data[i]; // Stamp of interest
    955         if (stamp->status == PM_SUBTRACTION_STAMP_USED && deviations->data.F32[i] > limit) {
    956             // Mask out the stamp in the image so you it's not found again
    957             psTrace("psModules.imcombine", 3, "Rejecting stamp %d (%d,%d)\n", i,
    958                     (int)(stamp->x + 0.5), (int)(stamp->y + 0.5));
    959             numRejected++;
    960             for (int y = stamp->y - footprint; y <= stamp->y + footprint; y++) {
    961                 for (int x = stamp->x - footprint; x <= stamp->x + footprint; x++) {
    962                     subMask->data.PS_TYPE_MASK_DATA[y][x] |= PM_SUBTRACTION_MASK_REJ;
     964        if (stamp->status == PM_SUBTRACTION_STAMP_USED) {
     965            if (deviations->data.F32[i] > limit) {
     966                // Mask out the stamp in the image so you it's not found again
     967                psTrace("psModules.imcombine", 3, "Rejecting stamp %d (%d,%d)\n", i,
     968                        (int)(stamp->x + 0.5), (int)(stamp->y + 0.5));
     969                numRejected++;
     970                for (int y = stamp->y - footprint; y <= stamp->y + footprint; y++) {
     971                    for (int x = stamp->x - footprint; x <= stamp->x + footprint; x++) {
     972                        subMask->data.PS_TYPE_MASK_DATA[y][x] |= PM_SUBTRACTION_MASK_REJ;
     973                    }
    963974                }
    964             }
    965 
    966             // Set stamp for replacement
    967             stamp->x = 0;
    968             stamp->y = 0;
    969             stamp->status = PM_SUBTRACTION_STAMP_REJECTED;
    970             // Recalculate convolutions
    971             psFree(stamp->convolutions);
    972             stamp->convolutions = NULL;
    973         }
    974     }
     975
     976                // Set stamp for replacement
     977                stamp->x = 0;
     978                stamp->y = 0;
     979                stamp->status = PM_SUBTRACTION_STAMP_REJECTED;
     980                // Recalculate convolutions
     981                psFree(stamp->convolutions);
     982                stamp->convolutions = NULL;
     983            } else {
     984                numGood++;
     985                newSquareDev += PS_SQR(deviations->data.F32[i]);
     986            }
     987        }
     988    }
     989
     990    psLogMsg("psModules.imcombine", PS_LOG_INFO, "%d good stamps; %d rejected.\nRMS deviation: %f --> %f\n",
     991             numGood, numRejected, sqrt(totalSquareDev / numStamps), sqrt(newSquareDev / numGood));
    975992
    976993    psFree(deviations);
Note: See TracChangeset for help on using the changeset viewer.