- Timestamp:
- May 26, 2009, 1:59:32 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
magic/remove/src/streaksremove.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
- Property svn:mergeinfo changed
-
branches/cnb_branches/cnb_branch_20090301/magic/remove/src/streaksremove.c
r21481 r24244 23 23 } 24 24 25 psMetadata *masks = psMetadataLookupMetadata(&status, config->recipes, "MASKS"); 26 if (!status) { 27 psError(PM_ERR_CONFIG, false, "failed to lookup MASKS in recipes\n"); 28 streaksExit("", PS_EXIT_CONFIG_ERROR); 29 } 30 double maskStreak = (double) psMetadataLookupU8(&status, masks, "STREAK"); 31 if (!status) { 32 psError(PM_ERR_CONFIG, false, "failed to lookup mask value for STREAK in recipes\n"); 33 streaksExit("", PS_EXIT_CONFIG_ERROR); 34 } 35 36 // optionally setting pixels with any mask bits execpt POOR.WARP to NAN 37 psU8 poorWarp = (double) psMetadataLookupU8(&status, masks, "POOR.WARP"); 38 if (!status) { 39 psError(PM_ERR_CONFIG, false, "failed to lookup mask value for POOR.WARP in recipes\n"); 40 streaksExit("", PS_EXIT_CONFIG_ERROR); 41 } 42 psU8 maskMask = ~poorWarp; 25 psU32 maskStreak = 0; 26 psU32 maskMask = 0; 43 27 44 28 psString streaksFileName = psMetadataLookupStr(NULL, config->arguments, "STREAKS"); … … 50 34 } 51 35 52 streakFiles *sfiles = openFiles(config, true );36 streakFiles *sfiles = openFiles(config, true, argv[0]); 53 37 setupAstrometry(sfiles); 54 38 … … 81 65 } 82 66 psF64 cwp_t = psTimerClear("COMPUTE_WARPED_PIXELS"); 83 p rintf("time to compute warped pixels: %f\n", cwp_t);67 psLogMsg("streaksremove", PS_LOG_INFO, "time to compute warped pixels: %f\n", cwp_t); 84 68 } 85 69 … … 114 98 } 115 99 100 // now that we've read the input files, lookup the mask values 101 if (maskStreak == 0) { 102 strkGetMaskValues(sfiles, &maskStreak, &maskMask); 103 } 104 116 105 totalPixels += sfiles->inImage->numRows * sfiles->inImage->numCols; 117 106 … … 124 113 sfiles->inImage->numCols, sfiles->inImage->numRows); 125 114 126 p rintf("time to get streak pixels: %f\n", psTimerClear("GET_STREAK_PIXELS"));115 psLogMsg("streaksremove", PS_LOG_INFO, "time to get streak pixels: %f\n", psTimerClear("GET_STREAK_PIXELS")); 127 116 128 117 … … 131 120 psTimerStart("EXCISE_NON_WARPED"); 132 121 122 // set non-warped pixels and variance to NAN, mask to maskStreak (since the pixel 123 // is excised as part of the destreaking process) 133 124 exciseNonWarpedPixels(sfiles, maskStreak); 134 125 135 p rintf("time to excise non warped pixels: %f\n", psTimerClear("EXCISE_NON_WARPED"));126 psLogMsg("streaksremove", PS_LOG_INFO, "time to excise non warped pixels: %f\n", psTimerClear("EXCISE_NON_WARPED")); 136 127 } 137 128 totalStreakPixels += psArrayLength(pixels); … … 149 140 } 150 141 } 151 p rintf("time to remove streak pixels: %f\n", psTimerClear("REMOVE_STREAKS"));142 psLogMsg("streaksremove", PS_LOG_INFO, "time to remove streak pixels: %f\n", psTimerClear("REMOVE_STREAKS")); 152 143 153 144 if (nanForRelease) { … … 170 161 writeImages(sfiles, exciseImageCube); 171 162 172 p rintf("time to process component %d: %f\n", sfiles->extnum, psTimerClear("PROCESS_COMPONENT"));163 psLogMsg("streaksremove", PS_LOG_INFO, "time to process component %d: %f\n", sfiles->extnum, psTimerClear("PROCESS_COMPONENT")); 173 164 } while (streakFilesNextExtension(sfiles)); 174 165 175 166 psFree(streaks); 176 167 177 p rintf("pixels: %ld streak pixels: %ld %4.2f%%\n", totalPixels, totalStreakPixels, 100. * totalStreakPixels / totalPixels);168 psLogMsg("streaksremove", PS_LOG_INFO, "pixels: %ld streak pixels: %ld %4.2f%%\n", totalPixels, totalStreakPixels, 100. * totalStreakPixels / totalPixels); 178 169 179 170 psTimerStart("CLOSE_IMAGES"); 180 171 // close all files 181 172 closeImages(sfiles); 182 p rintf("time to close images: %f\n", psTimerClear("CLOSE_IMAGES"));173 psLogMsg("streaksremove", PS_LOG_INFO, "time to close images: %f\n", psTimerClear("CLOSE_IMAGES")); 183 174 184 175 // NOTE: from here on we can't just quit if something goes wrong. … … 227 218 streaksNebulousCleanup(); 228 219 pmConfigDone(); 229 p rintf("time to run streaksremove: %f\n", psTimerClear("STREAKSREMOVE"));220 psLogMsg("streaksremove", PS_LOG_INFO, "time to run streaksremove: %f\n", psTimerClear("STREAKSREMOVE")); 230 221 psLibFinalize(); 231 222 … … 648 639 } 649 640 } 641 // XXX: check this 650 642 // Assumption: there are no mask and weight images for video cells 651 643 return;
Note:
See TracChangeset
for help on using the changeset viewer.
