- Timestamp:
- Mar 29, 2010, 3:55:49 PM (16 years ago)
- Location:
- branches/eam_branches/20100225
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
magic/remove/src/streaksremove.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20100225
- Property svn:mergeinfo changed
-
branches/eam_branches/20100225/magic/remove/src/streaksremove.c
r26983 r27517 12 12 static pmConfig *parseArguments(int argc, char **argv); 13 13 static bool readAndCopyToOutput(streakFiles *sf, bool exciseAll); 14 static voidexciseNonDiffedPixels(streakFiles *sfiles, psImageMaskType newMaskValue);14 static long exciseNonDiffedPixels(streakFiles *sfiles, psImageMaskType newMaskValue); 15 15 static bool diffedPixel(streakFiles *sfiles, int x, int y); 16 16 static void excisePixel(streakFiles *sfiles, unsigned int x, unsigned int y, bool streak, psImageMaskType newMaskValue); … … 104 104 long totalPixels = 0; 105 105 long totalStreakPixels = 0; 106 long nonDiffedPixels = 0; 106 107 107 108 // accumulators for the various timers … … 153 154 // set non-diffed pixels and variance to NAN, mask to maskStreak (since the pixel 154 155 // is excised as part of the destreaking process) 155 exciseNonDiffedPixels(sfiles, sfiles->maskStreak);156 nonDiffedPixels += exciseNonDiffedPixels(sfiles, sfiles->maskStreak); 156 157 157 158 enw_t += psTimerClear("EXCISE_NON_DIFFED"); … … 215 216 216 217 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); 218 220 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); 219 225 220 226 // check the weight and mask files for extra extensions that might be in files … … 305 311 for (int x = 0; x < sfiles->inImage->numCols; x++) { 306 312 if (psImageGet(pixels, x, y)) { 307 ++streakPixels;308 313 if (!checkNonDiffedPixels || diffedPixel(sfiles, x, y)) { 314 ++streakPixels; 309 315 310 316 excisePixel(sfiles, x, y, true, maskStreak); … … 795 801 } 796 802 797 static void803 static long 798 804 exciseNonDiffedPixels(streakFiles *sfiles, psImageMaskType newMaskValue) 799 805 { … … 804 810 int numCols = sfiles->inImage->numCols; // for raw images this was calculated from the width of datasec 805 811 int numRows = sfiles->inImage->numRows; // for raw images this was calculated from the height of datasec 812 813 long excisedPixels = 0; 806 814 807 815 // printf("%2d x0: %4d y0: %4d xpar: %d ypar: %d\n", sfiles->extnum, cell_x0, cell_y0, xParity, yParity); … … 825 833 if (! *pixels ) { 826 834 excisePixel(sfiles, xCell, yCell, false, newMaskValue); 835 excisedPixels++; 827 836 } 828 837 } … … 834 843 if (!*pixels) { 835 844 excisePixel(sfiles, xCell, yCell, false, newMaskValue); 845 excisedPixels++; 836 846 } 837 847 } 838 848 } 839 849 } 850 return excisedPixels; 840 851 } 841 852
Note:
See TracChangeset
for help on using the changeset viewer.
