IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 8, 2010, 7:39:53 PM (16 years ago)
Author:
bills
Message:

calculate the fraction of pixels not included because they were not
in the diff skycells

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/magic/remove/src/streaksremove.c

    r26983 r27222  
    1212static pmConfig *parseArguments(int argc, char **argv);
    1313static bool readAndCopyToOutput(streakFiles *sf, bool exciseAll);
    14 static void exciseNonDiffedPixels(streakFiles *sfiles, psImageMaskType newMaskValue);
     14static long exciseNonDiffedPixels(streakFiles *sfiles, psImageMaskType newMaskValue);
    1515static bool diffedPixel(streakFiles *sfiles, int x, int y);
    1616static void excisePixel(streakFiles *sfiles, unsigned int x, unsigned int y, bool streak, psImageMaskType newMaskValue);
     
    104104    long totalPixels = 0;
    105105    long totalStreakPixels = 0;
     106    long unDiffedPixels = 0;
    106107
    107108    // accumulators for the various timers
     
    153154                    // set non-diffed pixels and variance to NAN, mask to maskStreak (since the pixel
    154155                    // is excised as part of the destreaking process)
    155                     exciseNonDiffedPixels(sfiles, sfiles->maskStreak);
     156                    unDiffedPixels += exciseNonDiffedPixels(sfiles, sfiles->maskStreak);
    156157
    157158                    enw_t +=  psTimerClear("EXCISE_NON_DIFFED");
     
    217218    psLogMsg("streaksremove", PS_LOG_INFO, "pixels: %ld streak pixels: %ld %4.2f%%\n", totalPixels, totalStreakPixels, streakFraction * 100);
    218219    psMetadataAddF32(sfiles->stats, PS_LIST_TAIL, "STREAK_FRACTION", PS_META_REPLACE, "", streakFraction);
     220
     221    psF64 unDiffedFraction = (double) unDiffedPixels / totalPixels;
     222    psLogMsg("streaksremove", PS_LOG_INFO, "pixels: %ld undiffed pixels: %ld %4.2f%%\n", totalPixels, unDiffedPixels, unDiffedFraction * 100);
     223    psMetadataAddF32(sfiles->stats, PS_LIST_TAIL, "UNDIFFED_FRACTION", PS_META_REPLACE, "", unDiffedFraction);
    219224
    220225    // check the weight and mask files for extra extensions that might be in files
     
    795800}
    796801
    797 static void
     802static long
    798803exciseNonDiffedPixels(streakFiles *sfiles, psImageMaskType newMaskValue)
    799804{
     
    804809    int numCols = sfiles->inImage->numCols; // for raw images this was calculated from the width of datasec
    805810    int numRows = sfiles->inImage->numRows; // for raw images this was calculated from the height of datasec
     811
     812    long excisedPixels = 0;
    806813
    807814//    printf("%2d x0: %4d y0: %4d xpar: %d ypar: %d\n", sfiles->extnum, cell_x0, cell_y0, xParity, yParity);
     
    825832                if (! *pixels ) {
    826833                    excisePixel(sfiles, xCell, yCell, false, newMaskValue);
     834                    excisedPixels++;
    827835                }
    828836            }
     
    834842                if (!*pixels) {
    835843                    excisePixel(sfiles, xCell, yCell, false, newMaskValue);
     844                    excisedPixels++;
    836845                }
    837846            }
    838847        }
    839848    }
     849    return excisedPixels;
    840850}
    841851
Note: See TracChangeset for help on using the changeset viewer.