Changeset 26408 for trunk/magic/remove/src
- Timestamp:
- Dec 15, 2009, 2:10:35 PM (16 years ago)
- Location:
- trunk/magic/remove/src
- Files:
-
- 5 edited
-
streaksio.c (modified) (3 diffs)
-
streaksio.h (modified) (1 diff)
-
streaksrelease.c (modified) (2 diffs)
-
streaksremove.c (modified) (8 diffs)
-
streaksremove.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/streaksio.c
r26041 r26408 1182 1182 1183 1183 void 1184 strkGetMaskValues(streakFiles *sfiles, psU32 *maskStreak, psU32 *maskMask) 1185 { 1184 strkGetMaskValues(streakFiles *sfiles) 1185 { 1186 if (sfiles->maskStreak) { 1187 // already done 1188 return; 1189 } 1186 1190 if (sfiles->inMask && sfiles->inMask->header) { 1187 1191 if (!pmConfigMaskReadHeader(sfiles->config, sfiles->inMask->header)) { … … 1196 1200 streaksExit("", PS_EXIT_CONFIG_ERROR); 1197 1201 } 1198 *maskStreak = psMetadataLookupU32(&status, masks, "STREAK");1202 sfiles->maskStreak = psMetadataLookupU32(&status, masks, "STREAK"); 1199 1203 if (!status) { 1200 1204 psError(PM_ERR_CONFIG, false, "failed to lookup mask value for STREAK in recipes\n"); … … 1212 1216 } 1213 1217 } 1214 *maskMask = ~convPoor;1218 sfiles->maskMask = ~convPoor; 1215 1219 } 1216 1220 -
trunk/magic/remove/src/streaksio.h
r24853 r26408 16 16 void copyFitsOptions(sFile *out, sFile *rec, sFile *in, psVector *tiles); 17 17 void setupImageRefs(sFile *out, sFile *recoveryOut, sFile *in, int extnum, bool exciseAll); 18 void strkGetMaskValues(streakFiles *sfiles , psU32 *maskStreak, psU32 *maskMask);18 void strkGetMaskValues(streakFiles *sfiles); 19 19 void copyExtraExtensions(streakFiles *sfiles); 20 20 -
trunk/magic/remove/src/streaksrelease.c
r25082 r26408 16 16 return PS_EXIT_CONFIG_ERROR; 17 17 } 18 19 // Values to set for masked pixels20 psU32 maskStreak = 0; // for the image and weight (usually NAN, MAXINT for integer images)21 psU32 maskMask = 0; // value looked up for MASK.STREAK22 18 23 19 // Does true work here? … … 50 46 51 47 // now that we've read the input files, lookup the mask values that we read 52 if (maskStreak == 0) { 53 strkGetMaskValues(sfiles, &maskStreak, &maskMask); 54 } 55 56 setMaskedToNAN(sfiles, maskMask, true); 48 strkGetMaskValues(sfiles); 49 50 setMaskedToNAN(sfiles, sfiles->maskMask, true); 57 51 58 52 // write out the destreaked temporary images and the recovery images -
trunk/magic/remove/src/streaksremove.c
r26407 r26408 34 34 } 35 35 36 // Values to set for masked pixels37 psU32 maskStreak = 0; // for the image and weight (usually NAN, MAXINT for integer images)38 psU32 maskMask = 0; // value looked up for MASK.STREAK39 40 36 psString streaksFileName = psMetadataLookupStr(NULL, config->arguments, "STREAKS"); 41 37 … … 118 114 119 115 // now that we've read the input files, lookup the mask values 120 if (maskStreak == 0) { 121 strkGetMaskValues(sfiles, &maskStreak, &maskMask); 122 } 116 strkGetMaskValues(sfiles); 123 117 124 118 totalPixels += sfiles->inImage->numRows * sfiles->inImage->numCols; … … 142 136 // set non-warped pixels and variance to NAN, mask to maskStreak (since the pixel 143 137 // is excised as part of the destreaking process) 144 exciseNonWarpedPixels(sfiles, maskStreak);138 exciseNonWarpedPixels(sfiles, sfiles->maskStreak); 145 139 146 140 psLogMsg("streaksremove", PS_LOG_INFO, "time to excise non warped pixels: %f\n", psTimerClear("EXCISE_NON_WARPED")); … … 149 143 psTimerStart("REMOVE_STREAKS"); 150 144 151 totalStreakPixels += censorPixels(sfiles, pixels, checkNonWarpedPixels, maskStreak);145 totalStreakPixels += censorPixels(sfiles, pixels, checkNonWarpedPixels, sfiles->maskStreak); 152 146 153 147 psLogMsg("streaksremove", PS_LOG_INFO, "time to remove streak pixels: %f\n", psTimerClear("REMOVE_STREAKS")); … … 155 149 if (nanForRelease) { 156 150 // set any pixels that were masked, to NAN (unless they are already NAN) 157 setMaskedToNAN(sfiles, maskMask, true);151 setMaskedToNAN(sfiles, sfiles->maskMask, true); 158 152 } 159 153 … … 173 167 } 174 168 175 censorSources(sfiles, maskStreak);169 censorSources(sfiles, sfiles->maskStreak); 176 170 177 171 // write the destreaked "temporary" images and the recovery images … … 512 506 } 513 507 508 static void 509 setStreakBits(psImage *maskImage, psU32 maskStreak) 510 { 511 for (int y=0 ; y < maskImage->numRows; y++) { 512 for (int x=0 ; x < maskImage->numCols; x++) { 513 maskImage->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= maskStreak; 514 } 515 } 516 } 517 514 518 // set the image for the output files to the contents of the corresponding input file. 515 519 static bool … … 582 586 // Note: we don't excise the mask pixels even if exciseAll is true. 583 587 setupImageRefs(sf->outMask, sf->recMask, sf->inMask, sf->extnum, false); 588 if (exciseAll) { 589 strkGetMaskValues(sf); 590 591 setStreakBits(sf->inMask->image, sf->maskStreak); 592 } 584 593 if (sf->outChMask) { 585 594 sf->outChMask->header = (psMetadata *) psMemIncrRefCounter(sf->outMask->header); -
trunk/magic/remove/src/streaksremove.h
r25082 r26408 75 75 double transparentStreaks; 76 76 psString program_name; 77 psU32 maskStreak; 78 psU32 maskMask; 77 79 } streakFiles; 78 80
Note:
See TracChangeset
for help on using the changeset viewer.
