IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 18, 2011, 2:10:35 PM (15 years ago)
Author:
eugene
Message:

we had 3 items conceptually equivalent to the brightness of a peak: "value", "flux", and "SN"; Ive modified pmPeak to carry explicitly named elements "rawFlux", "smoothFlux", and "detValue". Ive also added the corresponding variance values for rawFlux and smoothFlux. This lets us choose independently of the peak detection process whether flux comparisons are done relative to the smoothed or unsmoothed image. It also simplifies tests of the peak flux compared to something else

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110213/psphot/src/psphotFindPeaks.c

    r26894 r30975  
    44// image must be constructed to represent (S/N)^2.  If nMax is non-zero, only return a maximum
    55// of nMax peaks
    6 psArray *psphotFindPeaks (psImage *significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int nMax) {
     6psArray *psphotFindPeaks (pmReadout *significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int nMax) {
    77
    88    bool status = false;
     
    1111
    1212    // 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);
    1415    if (peaks == NULL) {
    1516        // we only get a NULL peaks array due to a programming or config error.
     
    3435    for (int i = 0; i < peaks->n; i++) {
    3536        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
    4446        if (readout->variance && isfinite (peak->dx)) {
    4547            peak->dx *= sqrt(readout->variance->data.F32[peak->y-row0][peak->x-col0]);
     
    5153
    5254    // limit the total number of returned peaks as specified
    53     psArraySort (peaks, pmPeakSortBySN);
     55    psArraySort (peaks, pmPeaksSortByRawFluxDescend);
    5456    if (nMax && (peaks->n > nMax)) {
    5557        psArray *tmpPeaks = psArrayAllocEmpty (nMax);
Note: See TracChangeset for help on using the changeset viewer.