Changeset 20714
- Timestamp:
- Nov 12, 2008, 9:18:33 PM (17 years ago)
- Location:
- trunk/psModules/src/imcombine
- Files:
-
- 2 edited
-
pmSubtractionMatch.c (modified) (6 diffs)
-
pmSubtractionStamps.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmSubtractionMatch.c
r20568 r20714 213 213 int numCols = ro1->image->numCols, numRows = ro1->image->numRows; // Image dimensions 214 214 215 psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS, 0); // Random number generator 216 217 { 218 psStats *bg = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); // Statistics for backgroun 219 if (!psImageBackground(bg, NULL, ro1->image, ro1->mask, maskVal, rng)) { 220 psError(PS_ERR_UNKNOWN, false, "Unable to measure background statistics."); 221 psFree(bg); 222 psFree(rng); 223 goto MATCH_ERROR; 224 } 225 threshold = bg->robustMedian + threshold * bg->robustStdev; 226 psFree(bg); 227 psFree(rng); 228 } 229 215 230 memCheck("start"); 216 231 … … 270 285 // Get backgrounds 271 286 psStats *bgStats = psStatsAlloc(BG_STAT); // Statistics for background 272 psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS, 0); // Random number generator273 287 psVector *buffer = NULL;// Buffer for stats 274 288 if (!psImageBackground(bgStats, &buffer, ro1->image, ro1->mask, maskVal, rng)) { 275 289 psError(PS_ERR_UNKNOWN, false, "Unable to measure background of image 1."); 276 290 psFree(bgStats); 277 psFree(rng);278 291 psFree(buffer); 279 292 goto MATCH_ERROR; … … 283 296 psError(PS_ERR_UNKNOWN, false, "Unable to measure background of image 2."); 284 297 psFree(bgStats); 285 psFree(rng);286 298 psFree(buffer); 287 299 goto MATCH_ERROR; … … 289 301 float bg2 = psStatsGetValue(bgStats, BG_STAT); // Background for image 2 290 302 psFree(bgStats); 291 psFree(rng);292 303 psFree(buffer); 293 304 … … 423 434 } 424 435 } 436 psFree(rng); 437 rng = NULL; 425 438 psFree(region); 426 439 region = NULL; … … 473 486 psFree(stamps); 474 487 psFree(weight); 488 psFree(rng); 475 489 return false; 476 490 } -
trunk/psModules/src/imcombine/pmSubtractionStamps.c
r20465 r20714 301 301 fluxList->n = index; 302 302 303 goodStamp = true;303 goodStamp = (fluxStamp > threshold) ? true : false; 304 304 } else { 305 305 psTrace("psModules.imcombine", 9, "No sources in subregion %d", i);
Note:
See TracChangeset
for help on using the changeset viewer.
