Changeset 25354
- Timestamp:
- Sep 13, 2009, 4:52:04 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090715/psModules/src/objects/pmSource.c
r25022 r25354 282 282 283 283 psArray *peaks = NULL; 284 pmPSFClump errorClump = {-1.0, -1.0, 0.0, 0.0 };285 pmPSFClump emptyClump = {+0.0, +0.0, 0.0, 0.0 };284 pmPSFClump errorClump = {-1.0, -1.0, 0.0, 0.0, 0, 0.0}; 285 pmPSFClump emptyClump = {+0.0, +0.0, 0.0, 0.0, 0, 0.0}; 286 286 pmPSFClump psfClump; 287 287 … … 319 319 320 320 // construct a sigma-plane image 321 int numCols = SX_MAX / PSF_CLUMP_GRID_SCALE, numRows = SY_MAX / PSF_CLUMP_GRID_SCALE; // Size of sigma-plane image 321 int numCols = 1 + SX_MAX / PSF_CLUMP_GRID_SCALE; // Size of sigma-plane image 322 int numRows = 1 + SY_MAX / PSF_CLUMP_GRID_SCALE; // Size of sigma-plane image 322 323 psTrace("psModules.objects", 10, "sigma-plane dimensions: %dx%d\n", numCols, numRows); 323 324 psImage *splane = psImageAlloc(numCols, numRows, PS_TYPE_F32); // sigma-plane image … … 332 333 } 333 334 334 int x = src->peak->x, y = src->peak->y; // Coordinates of peak 335 if (x < region->x0 || x > region->x1 || y < region->y0 || y > region->y1) { 336 continue; 337 } 335 if (region) { 336 int x = src->peak->x, y = src->peak->y; // Coordinates of peak 337 if (x < region->x0 || x > region->x1 || y < region->y0 || y > region->y1) { 338 continue; 339 } 340 } 338 341 339 342 if (src->mode & PM_SOURCE_MODE_BLEND) { 340 343 continue; 341 344 } 345 346 if (!src->moments->nPixels) continue; 342 347 343 348 if (src->moments->SN < PSF_SN_LIM) { … … 384 389 385 390 // find the peak in this image 386 psStats *stats = psStatsAlloc (PS_STAT_MAX );391 psStats *stats = psStatsAlloc (PS_STAT_MAX | PS_STAT_SAMPLE_STDEV); 387 392 if (!psImageStats (stats, splane, NULL, 0)) { 388 393 psError(PS_ERR_UNKNOWN, false, "Unable to get image statistics.\n"); … … 393 398 peaks = pmPeaksInImage (splane, stats[0].max / 2); 394 399 psTrace ("psModules.objects", 2, "clump threshold is %f\n", stats[0].max/2); 400 401 psfClump.nSigma = stats->sampleStdev; 395 402 396 403 const bool keep_psf_clump = psMetadataLookupBool(NULL, recipe, "KEEP_PSF_CLUMP"); … … 430 437 psTrace ("psModules.objects", 2, "clump is at %d, %d (%f)\n", clump->x, clump->y, clump->value); 431 438 439 // XXX store the mean sigma? 440 float meanSigma = psfClump.nSigma; 441 psfClump.nStars = clump->value; 442 psfClump.nSigma = clump->value / meanSigma; 443 432 444 // define section window for clump 433 445 minSx = clump->x * PSF_CLUMP_GRID_SCALE - 2.0*PSF_CLUMP_GRID_SCALE; … … 452 464 continue; 453 465 454 if (tmpSrc->peak->x < region->x0) continue; 455 if (tmpSrc->peak->x > region->x1) continue; 456 if (tmpSrc->peak->y < region->y0) continue; 457 if (tmpSrc->peak->y > region->y1) continue; 466 if (region) { 467 if (tmpSrc->peak->x < region->x0) continue; 468 if (tmpSrc->peak->x > region->x1) continue; 469 if (tmpSrc->peak->y < region->y0) continue; 470 if (tmpSrc->peak->y > region->y1) continue; 471 } 458 472 459 473 if (tmpSrc->moments->Mxx < minSx)
Note:
See TracChangeset
for help on using the changeset viewer.
