Changeset 42435
- Timestamp:
- Mar 24, 2023, 9:45:49 AM (3 years ago)
- Location:
- branches/eam_branches/ipp-20230313/psphot/src
- Files:
-
- 1 added
- 3 edited
-
Makefile.am (modified) (1 diff)
-
psphot.h (modified) (1 diff)
-
psphotFindFeatures.c (added)
-
psphotSourceStats.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20230313/psphot/src/Makefile.am
r38386 r42435 247 247 psphotSetNFrames.c \ 248 248 psphotSourceMemory.c \ 249 psphotFindFeatures.c \ 249 250 psphotChipParams.c \ 250 251 psphotGalaxyParams.c -
branches/eam_branches/ipp-20230313/psphot/src/psphot.h
r42088 r42435 592 592 extern bool psphotINpsphotStack; 593 593 594 bool psphotFindFeatures (psArray *sources); 595 594 596 595 597 #endif -
branches/eam_branches/ipp-20230313/psphot/src/psphotSourceStats.c
r41359 r42435 120 120 source->moments = pmMomentsAlloc(); 121 121 122 // XXX can this ever be set at this point? (we just allocated the source and moments) 122 123 if (source->mode & PM_SOURCE_MODE_MOMENTS_FAILURE) { 123 124 fprintf (stderr, "moment failure\n"); … … 142 143 return true; 143 144 } 145 146 // XXX I want to identify sources which are on lines. these can be excluded from 147 // the Moments and PSF analysis 148 149 psphotFindFeatures (sources); 144 150 145 151 if (setWindow) { … … 539 545 sources = psArraySort (sources, pmSourceSortByFlux); 540 546 547 // generate an array of the sources which we want to use for this analysis 548 // XXX move max source number to config 549 psArray *sourceSubset = psArrayAllocEmpty (100); 550 for (int i = 0; (i < sources->n) && (i < 400); i++) { 551 552 pmSource *source = sources->data[i]; 553 554 // skip faint sources for moments measurement 555 if (sqrt(source->peak->detValue) < MIN_SN) continue; 556 557 // skip sources on lines 558 if (source->mode2 & PM_SOURCE_MODE2_ON_LINE) continue; 559 psArrayAdd (sourceSubset, 100, source); 560 } 561 541 562 // loop over radii: 542 563 for (int i = 0; i < nsigma; i++) { 543 544 // XXX move max source number to config 545 for (int j = 0; (j < sources->n) && (j < 400); j++) { 546 547 pmSource *source = sources->data[j]; 564 for (int j = 0; j < sourceSubset->n; j++) { 565 pmSource *source = sourceSubset->data[j]; 548 566 psAssert (source->moments, "force moments to exist"); 549 567 source->moments->nPixels = 0; … … 565 583 sprintf (name, "moments.v%d.dat", i); 566 584 FILE *fout = fopen (name, "w"); 567 for (int j = 0; j < source s->n; j++) {568 pmSource *source = source s->data[j];585 for (int j = 0; j < sourceSubset->n; j++) { 586 pmSource *source = sourceSubset->data[j]; 569 587 psAssert (source->moments, "force moments to exist"); 570 588 source->moments->nPixels = 0; … … 581 599 582 600 // determine the PSF parameters from the source moment values 583 pmPSFClump psfClump = pmSourcePSFClump (NULL, NULL, source s, PSF_SN_LIM, PSF_CLUMP_GRID_SCALE, MOMENTS_SX_MAX, MOMENTS_SY_MAX, MOMENTS_SX_MIN, MOMENTS_SY_MIN, MOMENTS_AR_MAX);601 pmPSFClump psfClump = pmSourcePSFClump (NULL, NULL, sourceSubset, PSF_SN_LIM, PSF_CLUMP_GRID_SCALE, MOMENTS_SX_MAX, MOMENTS_SY_MAX, MOMENTS_SX_MIN, MOMENTS_SY_MIN, MOMENTS_AR_MAX); 584 602 psLogMsg ("psphot", 3, "sigma guess (pix) %.1f, nStars: %d of %d in clump, nSigma: %5.2f, X, Y: %f, %f (%f, %f)\n", sigma[i], psfClump.nStars, psfClump.nTotal, psfClump.nSigma, psfClump.X, psfClump.Y, sqrt(psfClump.X) / sigma[i], sqrt(psfClump.Y) / sigma[i]); 585 603 586 Rmin[i] = pmSourceMinKronRadius(source s, PSF_SN_LIM);604 Rmin[i] = pmSourceMinKronRadius(sourceSubset, PSF_SN_LIM); 587 605 588 606 #if 0 … … 600 618 psMetadataAddF32 (regionMD, PS_LIST_TAIL, "PSF.CLUMP.DY", PS_META_REPLACE, "psf clump center", psfClump.dY); 601 619 if (pmVisualTestLevel("psphot.moments.full", 2)) { 602 psphotVisualPlotMoments (recipe, analysis, source s);620 psphotVisualPlotMoments (recipe, analysis, sourceSubset); 603 621 } 604 622 #endif … … 608 626 Sout[i] = (Nout[i] == 0) ? NAN : sqrt(0.5*(psfClump.X + psfClump.Y)) / sigma[i]; 609 627 } 628 629 psFree (sourceSubset); 610 630 611 631 // we are looking for sigma for which Sout = 0.65 (or some other value)
Note:
See TracChangeset
for help on using the changeset viewer.
