Changeset 31154 for trunk/psphot/src/psphotFindPeaks.c
- Timestamp:
- Apr 4, 2011, 1:12:39 PM (15 years ago)
- Location:
- trunk/psphot
- Files:
-
- 2 edited
-
. (modified) (2 props)
-
src/psphotFindPeaks.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot
- Property svn:ignore
-
old new 19 19 psphot-config 20 20 Doxyfile 21 a.out.dSYM
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
trunk/psphot/src/psphotFindPeaks.c
r26894 r31154 4 4 // image must be constructed to represent (S/N)^2. If nMax is non-zero, only return a maximum 5 5 // of nMax peaks 6 psArray *psphotFindPeaks (p sImage*significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int nMax) {6 psArray *psphotFindPeaks (pmReadout *significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int nMax) { 7 7 8 8 bool status = false; … … 11 11 12 12 // find the peaks in the smoothed image 13 psArray *peaks = pmPeaksInImage (significance, threshold); 13 // NOTE : significance->variance actually carries the detection S/N image 14 psArray *peaks = pmPeaksInImage (significance->variance, threshold); 14 15 if (peaks == NULL) { 15 16 // we only get a NULL peaks array due to a programming or config error. … … 34 35 for (int i = 0; i < peaks->n; i++) { 35 36 pmPeak *peak = peaks->data[i]; 36 peak->SN = sqrt(peak->value); 37 peak->flux = readout->image->data.F32[peak->y-row0][peak->x-col0]; 38 // if (peak->flux / peak->value > 5.0/12.0) { 39 // psWarning ("odd peak levels (1)"); 40 // } 41 // if (peak->value / peak->flux > 5*12.0) { 42 // psWarning ("odd peak levels (2)"); 43 // } 37 peak->rawFlux = readout->image->data.F32[peak->y-row0][peak->x-col0]; 38 peak->rawFluxStdev = sqrt(readout->variance->data.F32[peak->y-row0][peak->x-col0]); 39 peak->smoothFlux = significance->image->data.F32[peak->y-row0][peak->x-col0]; 40 peak->smoothFluxStdev = peak->smoothFlux / sqrt(significance->variance->data.F32[peak->y-row0][peak->x-col0]); 41 // NOTE smoothFluxStdev is actually (sqrt(variance) / covar_factor) 42 43 // do we need this or not? 44 // peak->SN = sqrt(peak->detValue); 45 44 46 if (readout->variance && isfinite (peak->dx)) { 45 47 peak->dx *= sqrt(readout->variance->data.F32[peak->y-row0][peak->x-col0]); … … 51 53 52 54 // limit the total number of returned peaks as specified 53 psArraySort (peaks, pmPeak SortBySN);55 psArraySort (peaks, pmPeaksSortByRawFluxDescend); 54 56 if (nMax && (peaks->n > nMax)) { 55 57 psArray *tmpPeaks = psArrayAllocEmpty (nMax);
Note:
See TracChangeset
for help on using the changeset viewer.
