Changeset 34307 for trunk/psphot/src/psphotSourceStats.c
- Timestamp:
- Aug 14, 2012, 1:08:16 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotSourceStats.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotSourceStats.c
r33840 r34307 521 521 float PSF_SN_LIM = 2.0*psMetadataLookupF32(&status, recipe, "PSF_SN_LIM"); psAssert (status, "missing PSF_SN_LIM"); 522 522 523 // XXX move this to a config file? 523 524 524 # define NSIGMA 8 525 float sigma[NSIGMA] = {1.0, 2.0, 3.0, 4.5, 6.0, 9.0, 12.0, 18.0}; 525 // moved to config file 526 // float sigma[NSIGMA] = {1.0, 2.0, 3.0, 4.5, 6.0, 9.0, 12.0, 18.0}; 527 psVector *sigmavec = psMetadataLookupPtr (&status, recipe, "PSF.SIGMA.VALUES"); psAssert(status, "missing PSF.SIGMA.VALUES"); 528 psAssert(sigmavec->n <= NSIGMA, "too many sigma values in recipe %ld maximum is %d", sigmavec->n, NSIGMA); 529 530 float sigma[NSIGMA]; 526 531 float Sout[NSIGMA]; 527 532 float Rmin[NSIGMA]; 528 533 int Nout[NSIGMA]; // number of stars found in clump : use this to control the number of regions measured by psphotRoughClass 529 534 535 // copy the data from vector to local array to keep the code below easier to read 536 for (int i = 0 ; i < sigmavec->n; i++) { 537 sigma[i] = sigmavec->data.F32[i]; 538 } 539 530 540 // this sorts by peak->rawFlux 531 541 sources = psArraySort (sources, pmSourceSortByFlux); 532 542 533 543 // loop over radii: 534 for (int i = 0; i < NSIGMA; i++) {544 for (int i = 0; i < sigmavec->n; i++) { 535 545 536 546 // XXX move max source number to config … … 589 599 float minS = Sout[0]; 590 600 float maxS = Sout[0]; 591 for (int i = 0; i < NSIGMA; i++) {601 for (int i = 0; i < sigmavec->n; i++) { 592 602 minS = PS_MIN(Sout[i], minS); 593 603 maxS = PS_MAX(Sout[i], maxS); 594 604 } 595 if (minS > 0.65) Sigma = sigma[ NSIGMA-1];605 if (minS > 0.65) Sigma = sigma[sigmavec->n-1]; 596 606 if (maxS < 0.65) Sigma = sigma[0]; 597 607 598 for (int i = 0; i < NSIGMA- 1 && isnan(Sigma); i++) {608 for (int i = 0; i < sigmavec->n - 1 && isnan(Sigma); i++) { 599 609 if (!isfinite(Sout[i]) || !isfinite(Sout[i+1])) continue; 600 610 if ((Sout[i] > 0.65) && (Sout[i+1] > 0.65)) continue;
Note:
See TracChangeset
for help on using the changeset viewer.
