Changeset 11160
- Timestamp:
- Jan 18, 2007, 6:38:26 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmSource.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSource.c
r10611 r11160 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.2 2$ $Name: not supported by cvs2svn $9 * @date $Date: 200 6-12-10 18:29:31$8 * @version $Revision: 1.23 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-01-19 04:38:26 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 329 329 psStats *stats = NULL; 330 330 331 // XXX EAM : this lets us takesthe single highest peak331 // select the single highest peak 332 332 psArraySort (peaks, pmPeaksCompareDescend); 333 333 clump = peaks->data[0]; 334 psTrace ("psModules.objects", 2, "clump is at %d, %d (%f)\n", clump->x, clump->y, clump-> counts);334 psTrace ("psModules.objects", 2, "clump is at %d, %d (%f)\n", clump->x, clump->y, clump->value); 335 335 336 336 // define section window for clump … … 343 343 tmpSy = psVectorAllocEmpty (sources->n, PS_TYPE_F32); 344 344 345 // XXX clip sources based on flux?346 345 // create vectors with Sx, Sy values in window 346 // clip sources based on S/N 347 347 for (psS32 i = 0 ; i < sources->n ; i++) 348 348 { 349 349 pmSource *tmpSrc = (pmSource *) sources->data[i]; 350 351 if (tmpSrc == NULL) 352 continue; 353 if (tmpSrc->moments == NULL) 354 continue; 355 if (tmpSrc->moments->SN < PSF_CLUMP_SN_LIM) 356 continue; 350 357 351 358 if (tmpSrc->moments->Sx < minSx) … … 380 387 psTrace ("psModules.objects", 2, "clump X, Y: %f, %f\n", psfClump.X, psfClump.Y); 381 388 psTrace ("psModules.objects", 2, "clump DX, DY: %f, %f\n", psfClump.dX, psfClump.dY); 382 // these values should be pushed on the recipe somewhere383 389 384 390 psFree (stats); … … 413 419 414 420 // report stats on S/N values for star-like objects 415 psVector *starsn = psVectorAllocEmpty (sources->n, PS_TYPE_F32); 421 psVector *starsn_peaks = psVectorAllocEmpty (sources->n, PS_TYPE_F32); 422 psVector *starsn_moments = psVectorAllocEmpty (sources->n, PS_TYPE_F32); 416 423 417 424 // get basic parameters, or set defaults … … 432 439 433 440 source->peak->type = 0; 441 442 // we are basically classifying by moments; use the default if not found 443 if (!source->moments) { 444 source->type = PM_SOURCE_TYPE_STAR; 445 source->mode |= PM_SOURCE_MODE_DEFAULT; 446 Nstar++; 447 continue; 448 } 434 449 435 450 psF32 sigX = source->moments->Sx; … … 482 497 483 498 // the rest are probable stellar objects 484 starsn->data.F32[starsn->n] = source->moments->SN; 485 starsn->n ++; 499 starsn_moments->data.F32[starsn_moments->n] = source->moments->SN; 500 starsn_moments->n ++; 501 starsn_peaks->data.F32[starsn_peaks->n] = source->peak->SN; 502 starsn_peaks->n ++; 486 503 Nstar ++; 487 504 … … 500 517 } 501 518 502 psStats *stats = NULL;519 psStats *stats = NULL; 503 520 stats = psStatsAlloc (PS_STAT_MIN | PS_STAT_MAX); 504 psVectorStats (stats, starsn , NULL, NULL, 0);505 506 ps LogMsg ("pmObjects", 3, "SN range: %f - %f\n", stats[0].min, stats[0].max);521 psVectorStats (stats, starsn_moments, NULL, NULL, 0); 522 psLogMsg ("pmObjects", 3, "SN range (moments): %f - %f\n", stats[0].min, stats[0].max); 523 psFree (starsn_moments); 507 524 psFree (stats); 508 psFree (starsn); 525 526 stats = psStatsAlloc (PS_STAT_MIN | PS_STAT_MAX); 527 psVectorStats (stats, starsn_peaks, NULL, NULL, 0); 528 psLogMsg ("pmObjects", 3, "SN range (peaks) : %f - %f\n", stats[0].min, stats[0].max); 529 psFree (starsn_peaks); 530 psFree (stats); 509 531 510 532 psTrace ("psModules.objects", 2, "Nstar: %3d\n", Nstar);
Note:
See TracChangeset
for help on using the changeset viewer.
