IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 29, 2010, 3:55:49 PM (16 years ago)
Author:
eugene
Message:

update merges from trunk

Location:
branches/eam_branches/20100225
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20100225

  • branches/eam_branches/20100225/magic/remove/src/streaksremove.c

    r26983 r27517  
    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 nonDiffedPixels = 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                    nonDiffedPixels += exciseNonDiffedPixels(sfiles, sfiles->maskStreak);
    156157
    157158                    enw_t +=  psTimerClear("EXCISE_NON_DIFFED");
     
    215216
    216217    psF64 streakFraction = (double) totalStreakPixels / totalPixels;
    217     psLogMsg("streaksremove", PS_LOG_INFO, "pixels: %ld streak pixels: %ld %4.2f%%\n", totalPixels, totalStreakPixels, streakFraction * 100);
     218    psLogMsg("streaksremove", PS_LOG_INFO, "   total pixels:  %8ld\n", totalPixels);
     219    psLogMsg("streaksremove", PS_LOG_INFO, "  streak pixels:  %8ld %4.2f%%\n", totalStreakPixels, streakFraction * 100);
    218220    psMetadataAddF32(sfiles->stats, PS_LIST_TAIL, "STREAK_FRACTION", PS_META_REPLACE, "", streakFraction);
     221
     222    psF64 nonDiffedFraction = (double) nonDiffedPixels / totalPixels;
     223    psLogMsg("streaksremove", PS_LOG_INFO, "nondiffed pixels:  %8ld %4.2f%%\n", nonDiffedPixels, nonDiffedFraction * 100);
     224    psMetadataAddF32(sfiles->stats, PS_LIST_TAIL, "NONDIFFED_FRACTION", PS_META_REPLACE, "", nonDiffedFraction);
    219225
    220226    // check the weight and mask files for extra extensions that might be in files
     
    305311        for (int x = 0; x < sfiles->inImage->numCols; x++) {
    306312            if (psImageGet(pixels, x, y)) {
    307                 ++streakPixels;
    308313                if (!checkNonDiffedPixels || diffedPixel(sfiles, x, y)) {
     314                    ++streakPixels;
    309315
    310316                    excisePixel(sfiles, x, y, true, maskStreak);
     
    795801}
    796802
    797 static void
     803static long
    798804exciseNonDiffedPixels(streakFiles *sfiles, psImageMaskType newMaskValue)
    799805{
     
    804810    int numCols = sfiles->inImage->numCols; // for raw images this was calculated from the width of datasec
    805811    int numRows = sfiles->inImage->numRows; // for raw images this was calculated from the height of datasec
     812
     813    long excisedPixels = 0;
    806814
    807815//    printf("%2d x0: %4d y0: %4d xpar: %d ypar: %d\n", sfiles->extnum, cell_x0, cell_y0, xParity, yParity);
     
    825833                if (! *pixels ) {
    826834                    excisePixel(sfiles, xCell, yCell, false, newMaskValue);
     835                    excisedPixels++;
    827836                }
    828837            }
     
    834843                if (!*pixels) {
    835844                    excisePixel(sfiles, xCell, yCell, false, newMaskValue);
     845                    excisedPixels++;
    836846                }
    837847            }
    838848        }
    839849    }
     850    return excisedPixels;
    840851}
    841852
Note: See TracChangeset for help on using the changeset viewer.