Changeset 20943 for trunk/magic/remove/src/streaksremove.c
- Timestamp:
- Dec 8, 2008, 3:27:32 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/magic/remove/src/streaksremove.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/streaksremove.c
r20844 r20943 16 16 17 17 psLibInit(NULL); 18 psTimerStart("STREAKSREMOVE"); 18 19 19 20 pmConfig *config = parseArguments(argc, argv); … … 61 62 // if no skycells are provided sfiles->exciseAll is set to true 62 63 64 psTimerStart("COMPUTE_WARPED_PIXELS"); 63 65 if (! computeWarpedPixels(sfiles) ) { 64 66 // we have no choice to excise all pixels 65 67 exciseAll = true; 66 68 } 69 psF64 cwp_t = psTimerClear("COMPUTE_WARPED_PIXELS"); 70 printf("time to compute warped pixels: %f\n", cwp_t); 67 71 } 68 72 … … 81 85 do { 82 86 bool exciseImageCube = false; 87 88 psTimerStart("PROCESS_COMPONENT"); 83 89 84 90 // read the images and copy the data from the inputs to the outputs … … 95 101 // Identify pixels to mask because of streaks 96 102 103 psTimerStart("GET_STREAK_PIXELS"); 104 97 105 StreakPixels *pixels = getStreakPixels(sfiles, streaks); 98 106 99 // XXX: 100 // 101 // PFS: Need to get mask weight for PM_MASK_DETECTOR. Is this stored 102 // in a config somewhere? Not sure how to properly set the maskValue. 103 107 printf("time to get streak pixels: %f\n", psTimerClear("GET_STREAK_PIXELS")); 104 108 105 109 if (checkNonWarpedPixels) { 110 psTimerStart("EXCISE_NON_WARPED"); 111 106 112 exciseNonWarpedPixels(sfiles, maskStreak); 113 114 printf("time to excise non warped pixels: %f\n", psTimerClear("EXCISE_NON_WARPED")); 107 115 } 108 116 109 117 if (sfiles->inImage->image) { 118 psTimerStart("REMOVE_STREAKS"); 110 119 for (int i = 0; i < psArrayLength (pixels); ++i) { 111 120 PixelPos *pixelPos = psArrayGet (pixels, i); … … 120 129 } 121 130 } 131 printf("time to remove streak pixels: %f\n", psTimerClear("REMOVE_STREAKS")); 122 132 } else { 123 133 // this component contains an image cube, excise it completely … … 130 140 writeImages(sfiles, exciseImageCube); 131 141 142 printf("time to process component %d: %f\n", sfiles->extnum, psTimerClear("PROCESS_COMPONENT")); 132 143 } while (streakFilesNextExtension(sfiles)); 133 144 145 146 psTimerStart("CLOSE_IMAGES"); 134 147 // close all files 135 148 closeImages(sfiles); 149 printf("time to close images: %f\n", psTimerClear("CLOSE_IMAGES")); 136 150 137 151 // NOTE: from here on we can't just quit if something goes wrong. … … 175 189 } 176 190 #endif // REPLACE, REMOVE 191 printf("time to run streaksremove: %f\n", psTimerClear("STREAKSREMOVE")); 192 177 193 // nebServerFree(ourNebServer); 178 194 psFree(config); … … 183 199 // PAU 184 200 fprintf(stderr, "Found %d leaks at %s\n", psMemCheckLeaks (0, NULL, NULL, false), "streaksremove"); 201 185 202 186 203 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.
