- Timestamp:
- Sep 5, 2012, 4:04:34 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20120805/psphot
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120805/psphot
- Property svn:mergeinfo changed
/trunk/psphot (added) merged: 34293,34307,34311,34317,34319,34321,34336,34338,34352-34354,34363
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120805/psphot/src
- Property svn:mergeinfo changed
/trunk/psphot/src (added) merged: 34293,34307,34311,34317,34319,34321,34336,34338,34352-34354,34363
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120805/psphot/src/psphotSourceStats.c
r34378 r34399 524 524 float PSF_SN_LIM = 2.0*psMetadataLookupF32(&status, recipe, "PSF_SN_LIM"); psAssert (status, "missing PSF_SN_LIM"); 525 525 526 // XXX move this to a config file?526 // XXX this will cause an error in the vector length is > 8 527 527 # define NSIGMA 8 528 float sigma[NSIGMA] = {1.0, 2.0, 3.0, 4.5, 6.0, 9.0, 12.0, 18.0}; 528 // moved to config file 529 psVector *sigmavec = psMetadataLookupPtr (&status, recipe, "PSF.SIGMA.VALUES"); 530 531 float sigma[NSIGMA]; 529 532 float Sout[NSIGMA]; 530 533 float Rmin[NSIGMA]; 531 534 int Nout[NSIGMA]; // number of stars found in clump : use this to control the number of regions measured by psphotRoughClass 532 535 536 int nsigma; 537 if (sigmavec) { 538 psAssert(sigmavec->n <= NSIGMA, "too many sigma values in recipe %ld maximum is %d", sigmavec->n, NSIGMA); 539 // copy the data from vector to local array to keep the code below easier to read 540 for (int i = 0 ; i < sigmavec->n; i++) { 541 sigma[i] = sigmavec->data.F32[i]; 542 } 543 assert (sigmavec->n <= 8); 544 nsigma = sigmavec->n; 545 } else { 546 // requiring this causes updates to pop an assertion 547 // psAssert(status, "missing PSF.SIGMA.VALUES"); 548 float defaultsigma[NSIGMA] = {1.0, 2.0, 3.0, 4.5, 6.0, 9.0, 12.0, 18.0}; 549 for (int i = 0 ; i < NSIGMA; i++) { 550 sigma[i] = defaultsigma[i]; 551 } 552 nsigma = NSIGMA; 553 } 554 533 555 // this sorts by peak->rawFlux 534 556 sources = psArraySort (sources, pmSourceSortByFlux); 535 557 536 558 // loop over radii: 537 for (int i = 0; i < NSIGMA; i++) {559 for (int i = 0; i < nsigma; i++) { 538 560 539 561 // XXX move max source number to config … … 592 614 float minS = Sout[0]; 593 615 float maxS = Sout[0]; 594 for (int i = 0; i < NSIGMA; i++) {616 for (int i = 0; i < nsigma; i++) { 595 617 minS = PS_MIN(Sout[i], minS); 596 618 maxS = PS_MAX(Sout[i], maxS); 597 619 } 598 if (minS > 0.65) Sigma = sigma[ NSIGMA-1];620 if (minS > 0.65) Sigma = sigma[nsigma-1]; 599 621 if (maxS < 0.65) Sigma = sigma[0]; 600 622 601 for (int i = 0; i < NSIGMA- 1 && isnan(Sigma); i++) {623 for (int i = 0; i < nsigma - 1 && isnan(Sigma); i++) { 602 624 if (!isfinite(Sout[i]) || !isfinite(Sout[i+1])) continue; 603 625 if ((Sout[i] > 0.65) && (Sout[i+1] > 0.65)) continue;
Note:
See TracChangeset
for help on using the changeset viewer.
