IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30974


Ignore:
Timestamp:
Mar 18, 2011, 2:09:39 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

Location:
branches/eam_branches/ipp-20110213/psModules
Files:
32 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110213/psModules/src/objects/models/pmModel_DEV.c

    r29004 r30974  
    249249
    250250    PAR[PM_PAR_SKY]  = 0.0;
    251     PAR[PM_PAR_I0]   = peak->flux / Io;
     251    PAR[PM_PAR_I0]   = peak->rawFlux / Io;
    252252    PAR[PM_PAR_XPOS] = peak->xf;
    253253    PAR[PM_PAR_YPOS] = peak->yf;
  • branches/eam_branches/ipp-20110213/psModules/src/objects/models/pmModel_EXP.c

    r29004 r30974  
    233233
    234234    PAR[PM_PAR_SKY]  = 0.0;
    235     PAR[PM_PAR_I0]   = peak->flux;
     235    PAR[PM_PAR_I0]   = peak->rawFlux;
    236236    PAR[PM_PAR_XPOS] = peak->xf;
    237237    PAR[PM_PAR_YPOS] = peak->yf;
  • branches/eam_branches/ipp-20110213/psModules/src/objects/models/pmModel_GAUSS.c

    r29004 r30974  
    207207
    208208    PAR[PM_PAR_SKY]  = 0.0;
    209     PAR[PM_PAR_I0]   = peak->flux;
     209    PAR[PM_PAR_I0]   = peak->rawFlux;
    210210    PAR[PM_PAR_XPOS] = peak->xf;
    211211    PAR[PM_PAR_YPOS] = peak->yf;
  • branches/eam_branches/ipp-20110213/psModules/src/objects/models/pmModel_PGAUSS.c

    r29004 r30974  
    207207
    208208    PAR[PM_PAR_SKY]  = 0.0;
    209     PAR[PM_PAR_I0]   = peak->flux;
     209    PAR[PM_PAR_I0]   = peak->rawFlux;
    210210    PAR[PM_PAR_XPOS] = peak->xf;
    211211    PAR[PM_PAR_YPOS] = peak->yf;
  • branches/eam_branches/ipp-20110213/psModules/src/objects/models/pmModel_PS1_V1.c

    r29004 r30974  
    236236
    237237    PAR[PM_PAR_SKY]  = 0.0;
    238     PAR[PM_PAR_I0]   = peak->flux;
     238    PAR[PM_PAR_I0]   = peak->rawFlux;
    239239    PAR[PM_PAR_XPOS] = peak->xf;
    240240    PAR[PM_PAR_YPOS] = peak->yf;
  • branches/eam_branches/ipp-20110213/psModules/src/objects/models/pmModel_QGAUSS.c

    r29004 r30974  
    237237
    238238    PAR[PM_PAR_SKY]  = 0.0;
    239     PAR[PM_PAR_I0]   = peak->flux;
     239    PAR[PM_PAR_I0]   = peak->rawFlux;
    240240    PAR[PM_PAR_XPOS] = peak->xf;
    241241    PAR[PM_PAR_YPOS] = peak->yf;
  • branches/eam_branches/ipp-20110213/psModules/src/objects/models/pmModel_RGAUSS.c

    r29004 r30974  
    226226
    227227    PAR[PM_PAR_SKY]  = 0.0;
    228     PAR[PM_PAR_I0]   = peak->flux;
     228    PAR[PM_PAR_I0]   = peak->rawFlux;
    229229    PAR[PM_PAR_XPOS] = peak->xf;
    230230    PAR[PM_PAR_YPOS] = peak->yf;
  • branches/eam_branches/ipp-20110213/psModules/src/objects/models/pmModel_SERSIC.c

    r29028 r30974  
    274274
    275275    PAR[PM_PAR_SKY]  = 0.0;
    276     PAR[PM_PAR_I0]   = peak->flux / Io;
     276    PAR[PM_PAR_I0]   = peak->rawFlux / Io;
    277277    PAR[PM_PAR_XPOS] = peak->xf;
    278278    PAR[PM_PAR_YPOS] = peak->yf;
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprint.c

    r30621 r30974  
    9898}
    9999
     100// XXX not actually used anywhere
    100101pmFootprint *pmFootprintNormalize(pmFootprint *fp) {
    101102    if (fp != NULL && !fp->normalized) {
    102         fp->peaks = psArraySort(fp->peaks, pmPeakSortBySN);
     103        if (PM_PEAKS_CULL_WITH_SMOOTHED_IMAGE) {
     104            fp->peaks = psArraySort(fp->peaks, pmPeaksSortBySmoothFluxDescend);
     105        } else {
     106            fp->peaks = psArraySort(fp->peaks, pmPeaksSortByRawFluxDescend);
     107        }
    103108        fp->normalized = true;
    104109    }
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprint.h

    r30902 r30974  
    1010#ifndef PM_FOOTPRINT_H
    1111#define PM_FOOTPRINT_H
     12
     13// We need to choose up front if the culling algorithm uses the raw or smoothed image.
     14// depending on which we choose, we should produce sorted peaks based on peak->rawFlux or
     15// peak->smoothFlux
     16
     17# define PM_PEAKS_CULL_WITH_SMOOTHED_IMAGE 1
    1218
    1319typedef struct {
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprintAssignPeaks.c

    r30815 r30974  
    6060        if (ids) { assert (x >= 0 && x < numCols && y >= 0 && y < numRows);}
    6161        int id = ids ? ids->data.S32[y][x - col0] : 0;
     62        // XXX I think the '[x - col0]' above is just wrong (should be [x], but never gets triggerd.
    6263
    6364        if (id == 0) {                  // peak isn't in a footprint, so make one for it
     
    8687        if (fp->peaks->n == 1) continue;
    8788
    88         fp->peaks = psArraySort(fp->peaks, pmPeakSortBySN);
     89        // make sure the peaks are sorted in a way consistent with our cull process
     90        if (PM_PEAKS_CULL_WITH_SMOOTHED_IMAGE) {
     91            fp->peaks = psArraySort(fp->peaks, pmPeaksSortBySmoothFluxDescend);
     92        } else {
     93            fp->peaks = psArraySort(fp->peaks, pmPeaksSortByRawFluxDescend);
     94        }
    8995
    9096        // XXX check for an assert on duplicates (I don't think they can happen, but
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmPeaks.c

    r30751 r30974  
    115115XXX: Macro this.
    116116*****************************************************************************/
     117# if (0)
    117118static bool isItInThisRegion(const psRegion valid,
    118119                             psS32 x,
     
    130131    return(false);
    131132}
     133# endif
    132134
    133135/******************************************************************************
     
    148150    tmp->x = x;
    149151    tmp->y = y;
    150     tmp->value = value;
    151     tmp->flux = value;
    152     tmp->SN = 0;
     152    tmp->detValue        = value;
     153    tmp->rawFlux         = NAN;
     154    tmp->rawFluxStdev    = NAN;
     155    tmp->smoothFlux      = NAN;
     156    tmp->smoothFluxStdev = NAN;
     157    // tmp->SN = 0;
    153158    tmp->xf = x;
    154159    tmp->yf = y;
     
    170175
    171176
    172 // psSort comparison function for peaks
     177// psSort comparison functions for peaks
    173178// XXX: Add error-checking for NULL args
    174 int pmPeaksCompareAscend (const void **a, const void **b)
    175 {
    176     psTrace("psModules.objects", 10, "---- %s() begin ----\n", __func__);
     179int pmPeaksSortByDetValueAscend (const void **a, const void **b)
     180{
    177181    pmPeak *A = *(pmPeak **)a;
    178182    pmPeak *B = *(pmPeak **)b;
     
    180184    psF32 diff;
    181185
    182     diff = A->value - B->value;
     186    diff = A->detValue - B->detValue;
    183187    if (diff < FLT_EPSILON) {
    184         psTrace("psModules.objects", 10, "---- %s(-1) end ----\n", __func__);
    185188        return (-1);
    186189    } else if (diff > FLT_EPSILON) {
    187         psTrace("psModules.objects", 10, "---- %s(+1) end ----\n", __func__);
    188190        return (+1);
    189191    }
    190     psTrace("psModules.objects", 10, "---- %s(0) end ----\n", __func__);
    191192    return (0);
    192193}
    193 
    194 // psSort comparison function for peaks
    195 // XXX: Add error-checking for NULL args
    196 int pmPeaksCompareDescend (const void **a, const void **b)
    197 {
    198     psTrace("psModules.objects", 10, "---- %s() begin ----\n", __func__);
     194int pmPeaksSortByDetValueDescend (const void **a, const void **b)
     195{
    199196    pmPeak *A = *(pmPeak **)a;
    200197    pmPeak *B = *(pmPeak **)b;
     
    202199    psF32 diff;
    203200
    204     diff = A->value - B->value;
     201    diff = A->detValue - B->detValue;
    205202    if (diff < FLT_EPSILON) {
    206         psTrace("psModules.objects", 10, "---- %s(+1) end ----\n", __func__);
    207203        return (+1);
    208204    } else if (diff > FLT_EPSILON) {
    209         psTrace("psModules.objects", 10, "---- %s(-1) end ----\n", __func__);
    210205        return (-1);
    211206    }
    212     psTrace("psModules.objects", 10, "---- %s(0) end ----\n", __func__);
    213207    return (0);
    214208}
    215 
    216 // sort by SN (descending)
    217 int pmPeakSortBySN (const void **a, const void **b)
     209int pmPeaksSortByRawFluxAscend (const void **a, const void **b)
    218210{
    219211    pmPeak *A = *(pmPeak **)a;
    220212    pmPeak *B = *(pmPeak **)b;
    221213
    222     psF32 fA = A->flux;
    223     psF32 fB = B->flux;
    224     if (isnan (fA)) fA = 0;
    225     if (isnan (fB)) fB = 0;
    226 
    227     psF32 diff = fA - fB;
    228     if (diff > FLT_EPSILON) return (-1);
    229     if (diff < FLT_EPSILON) return (+1);
     214    psF32 diff;
     215
     216    diff = A->rawFlux - B->rawFlux;
     217    if (diff < FLT_EPSILON) {
     218        return (-1);
     219    } else if (diff > FLT_EPSILON) {
     220        return (+1);
     221    }
    230222    return (0);
    231223}
    232 
    233 // sort by Y (ascending)
    234 int pmPeakSortByY (const void **a, const void **b)
     224int pmPeaksSortByRawFluxDescend (const void **a, const void **b)
    235225{
    236226    pmPeak *A = *(pmPeak **)a;
    237227    pmPeak *B = *(pmPeak **)b;
    238228
    239     psF32 fA = A->y;
    240     psF32 fB = B->y;
    241 
    242     psF32 diff = fA - fB;
    243     if (diff > FLT_EPSILON) return (+1);
    244     if (diff < FLT_EPSILON) return (-1);
     229    psF32 diff;
     230
     231    diff = A->rawFlux - B->rawFlux;
     232    if (diff < FLT_EPSILON) {
     233        return (+1);
     234    } else if (diff > FLT_EPSILON) {
     235        return (-1);
     236    }
    245237    return (0);
    246238}
     239int pmPeaksSortBySmoothFluxAscend (const void **a, const void **b)
     240{
     241    pmPeak *A = *(pmPeak **)a;
     242    pmPeak *B = *(pmPeak **)b;
     243
     244    psF32 diff;
     245
     246    diff = A->smoothFlux - B->smoothFlux;
     247    if (diff < FLT_EPSILON) {
     248        return (-1);
     249    } else if (diff > FLT_EPSILON) {
     250        return (+1);
     251    }
     252    return (0);
     253}
     254int pmPeaksSortBySmoothFluxDescend (const void **a, const void **b)
     255{
     256    pmPeak *A = *(pmPeak **)a;
     257    pmPeak *B = *(pmPeak **)b;
     258
     259    psF32 diff;
     260
     261    diff = A->smoothFlux - B->smoothFlux;
     262    if (diff < FLT_EPSILON) {
     263        return (+1);
     264    } else if (diff > FLT_EPSILON) {
     265        return (-1);
     266    }
     267    return (0);
     268}
     269
     270// // sort by SN (descending)
     271// int pmPeakSortBySN (const void **a, const void **b)
     272// {
     273//     pmPeak *A = *(pmPeak **)a;
     274//     pmPeak *B = *(pmPeak **)b;
     275//
     276//     psF32 fA = A->flux;
     277//     psF32 fB = B->flux;
     278//     if (isnan (fA)) fA = 0;
     279//     if (isnan (fB)) fB = 0;
     280//
     281//     psF32 diff = fA - fB;
     282//     if (diff > FLT_EPSILON) return (-1);
     283//     if (diff < FLT_EPSILON) return (+1);
     284//     return (0);
     285// }
     286//
     287// // sort by Y (ascending)
     288// int pmPeakSortByY (const void **a, const void **b)
     289// {
     290//     pmPeak *A = *(pmPeak **)a;
     291//     pmPeak *B = *(pmPeak **)b;
     292//
     293//     psF32 fA = A->y;
     294//     psF32 fB = B->y;
     295//
     296//     psF32 diff = fA - fB;
     297//     if (diff > FLT_EPSILON) return (+1);
     298//     if (diff < FLT_EPSILON) return (-1);
     299//     return (0);
     300// }
    247301
    248302/******************************************************************************
     
    554608    return(list);
    555609}
    556 
    557 // return a new array of peaks which are in the valid region and below threshold
    558 // XXX this function is unused and probably could be dropped
    559 psArray *pmPeaksSubset(
    560     psArray *peaks,
    561     psF32 maxValue,
    562     const psRegion valid)
    563 {
    564     psTrace("psModules.objects", 10, "---- %s() begin ----\n", __func__);
    565     PS_ASSERT_PTR_NON_NULL(peaks, NULL);
    566 
    567     psArray *output = psArrayAllocEmpty (200);
    568 
    569     psTrace ("psModules.objects", 3, "list size is %ld\n", peaks->n);
    570 
    571     for (int i = 0; i < peaks->n; i++) {
    572         pmPeak *tmpPeak = (pmPeak *) peaks->data[i];
    573         if (tmpPeak->value > maxValue)
    574             continue;
    575         if (isItInThisRegion(valid, tmpPeak->x, tmpPeak->y))
    576             continue;
    577         psArrayAdd (output, 200, tmpPeak);
    578     }
    579     psTrace("psModules.objects", 10, "---- %s() end ----\n", __func__);
    580     return(output);
    581 }
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmPeaks.h

    r30865 r30974  
    4646 *  associated with the source:
    4747 *
     48 *  There are 3 values which define the amplitude of the peak and which may be used to sort the
     49 *  peaks:
     50 *  * detValue - the peak in the detection image (nominally, the S/N)
     51 *  * rawFlux - the peak in the unsmoothed image
     52 *  * smoothFlux - the peak in the smoothed image
     53 *
     54 *  For a given image, peaks do necesarily not have the same sequence for these three values.
     55 *  Depending on the analysis, it may make sense to sort by one or the other of these values
    4856 */
    4957typedef struct
     
    5664    float dx;                           ///< bicube fit error on peak coord (x)
    5765    float dy;                           ///< bicube fit error on peak coord (y)
    58     float value;                        ///< level in detection image
    59     float flux;                         ///< level in unsmoothed sci image
    60     float SN;                           ///< S/N implied by detection level
     66    float detValue;                     ///< peak flux in detection image (= S/N)
     67    float rawFlux;                      ///< peak flux in unsmoothed signal image
     68    float rawFluxStdev;                 ///< peak stdev in unsmoothed signal image
     69    float smoothFlux;                   ///< peak flux in smoothed signal image
     70    float smoothFluxStdev;              ///< peak stdev in smoothed signal image
     71    // float SNestimated;                  ///< S/N estimated from the detection image
    6172    bool assigned;                      ///< is peak assigned to a source?
    6273    pmPeakType type;                    ///< Description of peak.
     
    137148);
    138149
    139 int pmPeaksCompareAscend (const void **a, const void **b);
    140 int pmPeaksCompareDescend (const void **a, const void **b);
    141 
    142 int pmPeakSortBySN (const void **a, const void **b);
    143 int pmPeakSortByY (const void **a, const void **b);
     150int pmPeaksSortByDetValueAscend (const void **a, const void **b);
     151int pmPeaksSortByDetValueDescend (const void **a, const void **b);
     152int pmPeaksSortByRawFluxAscend (const void **a, const void **b);
     153int pmPeaksSortByRawFluxDescend (const void **a, const void **b);
     154int pmPeaksSortBySmoothFluxAscend (const void **a, const void **b);
     155int pmPeaksSortBySmoothFluxDescend (const void **a, const void **b);
    144156
    145157/// @}
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmPhotObj.c

    r30892 r30974  
    8181        object->x  = source->peak->xf;
    8282        object->y  = source->peak->yf;
    83         object->SN = source->peak->SN;
     83        object->flux = source->peak->rawFlux;
    8484    } else {
    85         object->SN = PS_MAX(object->SN, source->peak->SN);
     85        object->flux = PS_MAX(object->flux, source->peak->rawFlux);
    8686    }
    8787    psArrayAdd (object->sources, 1, source);
     
    8989}
    9090
    91 // sort by SN (descending)
    92 int pmPhotObjSortBySN (const void **a, const void **b)
     91// sort by flux (descending)
     92int pmPhotObjSortByFlux (const void **a, const void **b)
    9393{
    9494    pmPhotObj *objA = *(pmPhotObj **)a;
    9595    pmPhotObj *objB = *(pmPhotObj **)b;
    9696
    97     psF32 fA = objA->SN;
    98     psF32 fB = objB->SN;
     97    psF32 fA = objA->flux;
     98    psF32 fB = objB->flux;
    9999
    100100    psF32 diff = fA - fB;
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmPhotObj.h

    r29004 r30974  
    3434    float x;
    3535    float y;
    36     float SN;                           // max of peak->SN for all matched sources
     36    float flux;                         // max of peak->rawFlux for all matched sources
    3737} pmPhotObj;
    3838
     
    4141bool pmPhotObjAddSource(pmPhotObj *object, pmSource *source);
    4242
    43 int pmPhotObjSortBySN (const void **a, const void **b);
     43int pmPhotObjSortByFlux (const void **a, const void **b);
    4444int pmPhotObjSortByX (const void **a, const void **b);
    4545
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmSource.c

    r30935 r30974  
    171171    // peak has the same values as the original
    172172    if (in->peak != NULL) {
    173         source->peak = pmPeakAlloc (in->peak->x, in->peak->y, in->peak->value, in->peak->type);
     173        source->peak = pmPeakAlloc (in->peak->x, in->peak->y, in->peak->detValue, in->peak->type);
    174174        source->peak->xf = in->peak->xf;
    175175        source->peak->yf = in->peak->yf;
    176         source->peak->flux = in->peak->flux;
    177         source->peak->SN = in->peak->SN;
     176        source->peak->rawFlux         = in->peak->rawFlux;
     177        source->peak->rawFluxStdev    = in->peak->rawFluxStdev;
     178        source->peak->smoothFlux      = in->peak->smoothFlux;
     179        source->peak->smoothFluxStdev = in->peak->smoothFluxStdev;
     180        // source->peak->SN = in->peak->SN;
    178181    }
    179182
     
    462465        psStats *stats  = NULL;
    463466
    464         // select the single highest peak
    465         psArraySort (peaks, pmPeaksCompareDescend);
     467        // select the single highest peak (note that we only have detValue, not rawFlux, etc
     468        psArraySort (peaks, pmPeaksSortByDetValueDescend);
    466469        clump = peaks->data[0];
    467         psTrace ("psModules.objects", 2, "clump is at %d, %d (%f)\n", clump->x, clump->y, clump->value);
     470        psTrace ("psModules.objects", 2, "clump is at %d, %d (%f)\n", clump->x, clump->y, clump->detValue);
    468471
    469472        // XXX store the mean sigma?
    470473        float meanSigma = psfClump.nSigma;
    471         psfClump.nStars = clump->value;
    472         psfClump.nSigma = clump->value / meanSigma;
     474        psfClump.nStars = clump->detValue;
     475        psfClump.nSigma = clump->detValue / meanSigma;
    473476
    474477        // define section window for clump
     
    666669
    667670            // the rest are probable stellar objects
     671            // the vectors below are accumulated to give user feedback on the S/N ranges
    668672            starsn_moments->data.F32[starsn_moments->n] = source->moments->SN;
    669673            starsn_moments->n ++;
    670             starsn_peaks->data.F32[starsn_peaks->n] = source->peak->SN;
     674            starsn_peaks->data.F32[starsn_peaks->n] = sqrt(source->peak->detValue);
    671675            starsn_peaks->n ++;
    672676            Nstar ++;
     
    11861190
    11871191// sort by SN (descending)
    1188 int pmSourceSortBySN (const void **a, const void **b)
     1192int pmSourceSortByFlux (const void **a, const void **b)
    11891193{
    11901194    pmSource *A = *(pmSource **)a;
    11911195    pmSource *B = *(pmSource **)b;
    11921196
    1193     psF32 fA = (A->peak == NULL) ? 0 : A->peak->SN;
    1194     psF32 fB = (B->peak == NULL) ? 0 : B->peak->SN;
     1197    psF32 fA = (A->peak == NULL) ? 0 : A->peak->rawFlux;
     1198    psF32 fB = (B->peak == NULL) ? 0 : B->peak->rawFlux;
    11951199    if (isnan (fA)) fA = 0;
    11961200    if (isnan (fB)) fB = 0;
     
    12031207
    12041208// sort by SN (descending)
    1205 int pmSourceSortByParentSN (const void **a, const void **b)
     1209int pmSourceSortByParentFlux (const void **a, const void **b)
    12061210{
    12071211    pmSource *Ao = *(pmSource **)a;
     
    12101214    pmSource *B  = Bo->parent;
    12111215
    1212     psF32 fA = (A->peak == NULL) ? 0 : A->peak->SN;
    1213     psF32 fB = (B->peak == NULL) ? 0 : B->peak->SN;
     1216    psF32 fA = (A->peak == NULL) ? 0 : A->peak->rawFlux;
     1217    psF32 fB = (B->peak == NULL) ? 0 : B->peak->rawFlux;
    12141218    if (isnan (fA)) fA = 0;
    12151219    if (isnan (fB)) fB = 0;
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmSource.h

    r30935 r30974  
    293293int  pmSourceSortBySeq (const void **a, const void **b);
    294294int  pmSourceSortByParentSeq (const void **a, const void **b);
    295 int  pmSourceSortBySN (const void **a, const void **b);
    296 int  pmSourceSortByParentSN (const void **a, const void **b);
     295int  pmSourceSortByFlux (const void **a, const void **b);
     296int  pmSourceSortByParentFlux (const void **a, const void **b);
    297297
    298298pmSourceMode pmSourceModeFromString (const char *name);
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_DV1.c

    r30931 r30974  
    7575        if (source->seq == -1) {
    7676          // let's write these out in S/N order
    77           sources = psArraySort (sources, pmSourceSortBySN);
     77          sources = psArraySort (sources, pmSourceSortByFlux);
    7878        } else {
    7979          sources = psArraySort (sources, pmSourceSortBySeq);
     
    270270        // recreate the peak to match (xPos, yPos) +/- (xErr, yErr)
    271271        source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE);
    272         source->peak->flux = peakFlux;
     272        source->peak->rawFlux = peakFlux;
     273        source->peak->smoothFlux = peakFlux;
    273274        source->peak->xf   = PAR[PM_PAR_XPOS]; // more accurate position
    274275        source->peak->yf   = PAR[PM_PAR_YPOS]; // more accurate position
    275276        source->peak->dx   = dPAR[PM_PAR_XPOS];
    276277        source->peak->dy   = dPAR[PM_PAR_YPOS];
    277         if (isfinite (source->errMag) && (source->errMag > 0.0)) {
    278           source->peak->SN = 1.0 / source->errMag;
    279         } else {
    280           source->peak->SN = sqrt(source->peak->flux); // an alternate proxy: various functions sort by peak S/N
    281         }
    282278
    283279        source->pixWeightNotBad = psMetadataLookupF32 (&status, row, "PSF_QF");
     
    337333
    338334    // let's write these out in S/N order
    339     sources = psArraySort (sources, pmSourceSortBySN);
     335    sources = psArraySort (sources, pmSourceSortByFlux);
    340336
    341337    table = psArrayAllocEmpty (sources->n);
     
    510506
    511507    // let's write these out in S/N order
    512     sources = psArraySort (sources, pmSourceSortBySN);
     508    sources = psArraySort (sources, pmSourceSortByFlux);
    513509
    514510    // we are writing one row per model; we need to write out same number of columns for each row: find the max Nparams
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_DV2.c

    r30931 r30974  
    7474        if (source->seq == -1) {
    7575          // let's write these out in S/N order
    76           sources = psArraySort (sources, pmSourceSortBySN);
     76          sources = psArraySort (sources, pmSourceSortByFlux);
    7777        } else {
    7878          sources = psArraySort (sources, pmSourceSortBySeq);
     
    288288        // recreate the peak to match (xPos, yPos) +/- (xErr, yErr)
    289289        source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE);
    290         source->peak->flux = peakFlux;
     290        source->peak->rawFlux = peakFlux;
     291        source->peak->smoothFlux = peakFlux;
    291292        source->peak->xf   = PAR[PM_PAR_XPOS]; // more accurate position
    292293        source->peak->yf   = PAR[PM_PAR_YPOS]; // more accurate position
    293294        source->peak->dx   = dPAR[PM_PAR_XPOS];
    294295        source->peak->dy   = dPAR[PM_PAR_YPOS];
    295         if (isfinite (source->errMag) && (source->errMag > 0.0)) {
    296           source->peak->SN = 1.0 / source->errMag;
    297         } else {
    298           source->peak->SN = sqrt(source->peak->flux); // an alternate proxy: various functions sort by peak S/N
    299         }
    300296
    301297        source->pixWeightNotBad = psMetadataLookupF32 (&status, row, "PSF_QF");
     
    362358
    363359    // let's write these out in S/N order
    364     sources = psArraySort (sources, pmSourceSortBySN);
     360    sources = psArraySort (sources, pmSourceSortByFlux);
    365361
    366362    table = psArrayAllocEmpty (sources->n);
     
    535531
    536532    // let's write these out in S/N order
    537     sources = psArraySort (sources, pmSourceSortBySN);
     533    sources = psArraySort (sources, pmSourceSortByFlux);
    538534
    539535    // we are writing one row per model; we need to write out same number of columns for each row: find the max Nparams
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_SV1.c

    r30931 r30974  
    7676        pmSource *source = sources->data[0];
    7777        if (source->seq == -1) {
    78             sources = psArraySort (sources, pmSourceSortBySN);
     78            sources = psArraySort (sources, pmSourceSortByFlux);
    7979        } else {
    8080            sources = psArraySort (sources, pmSourceSortBySeq);
     
    287287        // recreate the peak to match (xPos, yPos) +/- (xErr, yErr)
    288288        source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE);
    289         source->peak->flux = peakFlux;
     289        source->peak->rawFlux = peakFlux;
     290        source->peak->smoothFlux = peakFlux;
    290291        source->peak->xf   = PAR[PM_PAR_XPOS]; // more accurate position
    291292        source->peak->yf   = PAR[PM_PAR_YPOS]; // more accurate position
    292293        source->peak->dx   = dPAR[PM_PAR_XPOS];
    293294        source->peak->dy   = dPAR[PM_PAR_YPOS];
    294         if (isfinite (source->errMag) && (source->errMag > 0.0)) {
    295           source->peak->SN = 1.0 / source->errMag;
    296         } else {
    297           source->peak->SN = sqrt(source->peak->flux); // an alternate proxy: various functions sort by peak S/N
    298         }
    299295
    300296        source->pixWeightNotBad = psMetadataLookupF32 (&status, row, "PSF_QF");
     
    384380
    385381    // let's write these out in S/N order
    386     sources = psArraySort (sources, pmSourceSortBySN);
     382    sources = psArraySort (sources, pmSourceSortByFlux);
    387383
    388384    table = psArrayAllocEmpty (sources->n);
     
    562558
    563559    // let's write these out in S/N order
    564     sources = psArraySort (sources, pmSourceSortBySN);
     560    sources = psArraySort (sources, pmSourceSortByFlux);
    565561
    566562    // we are writing one row per model; we need to write out same number of columns for each row: find the max Nparams
     
    732728
    733729    // let's write these out in S/N order
    734     sources = psArraySort (sources, pmSourceSortBySN);
     730    sources = psArraySort (sources, pmSourceSortByFlux);
    735731
    736732    table = psArrayAllocEmpty (sources->n);
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_V1.c

    r30931 r30974  
    7272        if (source->seq == -1) {
    7373          // let's write these out in S/N order
    74           sources = psArraySort (sources, pmSourceSortBySN);
     74          sources = psArraySort (sources, pmSourceSortByFlux);
    7575        } else {
    7676          sources = psArraySort (sources, pmSourceSortBySeq);
     
    255255        // recreate the peak to match (xPos, yPos) +/- (xErr, yErr)
    256256        source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE);
    257         source->peak->flux = peakFlux;
     257        source->peak->rawFlux = peakFlux;
     258        source->peak->smoothFlux = peakFlux;
    258259        source->peak->xf   = PAR[PM_PAR_XPOS]; // more accurate position
    259260        source->peak->yf   = PAR[PM_PAR_YPOS]; // more accurate position
    260261        source->peak->dx   = dPAR[PM_PAR_XPOS];
    261262        source->peak->dy   = dPAR[PM_PAR_YPOS];
    262         if (isfinite (source->errMag) && (source->errMag > 0.0)) {
    263           source->peak->SN = 1.0 / source->errMag;
    264         } else {
    265           source->peak->SN = sqrt(source->peak->flux); // an alternate proxy: various functions sort by peak S/N
    266         }
    267263
    268264        source->pixWeightNotBad = psMetadataLookupF32 (&status, row, "PSF_QF");
     
    312308
    313309    // let's write these out in S/N order
    314     sources = psArraySort (sources, pmSourceSortBySN);
     310    sources = psArraySort (sources, pmSourceSortByFlux);
    315311
    316312    table = psArrayAllocEmpty (sources->n);
     
    490486
    491487    // let's write these out in S/N order
    492     sources = psArraySort (sources, pmSourceSortBySN);
     488    sources = psArraySort (sources, pmSourceSortByFlux);
    493489
    494490    // we are writing one row per model; we need to write out same number of columns for each row: find the max Nparams
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_V2.c

    r30931 r30974  
    7272        if (source->seq == -1) {
    7373            // let's write these out in S/N order
    74             sources = psArraySort (sources, pmSourceSortBySN);
     74            sources = psArraySort (sources, pmSourceSortByFlux);
    7575        } else {
    7676            sources = psArraySort (sources, pmSourceSortBySeq);
     
    261261        // recreate the peak to match (xPos, yPos) +/- (xErr, yErr)
    262262        source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE);
    263         source->peak->flux = peakFlux;
     263        source->peak->rawFlux = peakFlux;
     264        source->peak->smoothFlux = peakFlux;
    264265        source->peak->xf   = PAR[PM_PAR_XPOS]; // more accurate position
    265266        source->peak->yf   = PAR[PM_PAR_YPOS]; // more accurate position
    266267        source->peak->dx   = dPAR[PM_PAR_XPOS];
    267268        source->peak->dy   = dPAR[PM_PAR_YPOS];
    268         if (isfinite (source->errMag) && (source->errMag > 0.0)) {
    269           source->peak->SN = 1.0 / source->errMag;
    270         } else {
    271           source->peak->SN = sqrt(source->peak->flux); // an alternate proxy: various functions sort by peak S/N
    272         }
    273269
    274270        source->pixWeightNotBad = psMetadataLookupF32 (&status, row, "PSF_QF");
     
    334330
    335331    // let's write these out in S/N order
    336     sources = psArraySort (sources, pmSourceSortBySN);
     332    sources = psArraySort (sources, pmSourceSortByFlux);
    337333
    338334    table = psArrayAllocEmpty (sources->n);
     
    553549
    554550    // let's write these out in S/N order
    555     sources = psArraySort (sources, pmSourceSortBySN);
     551    sources = psArraySort (sources, pmSourceSortByFlux);
    556552
    557553    // we are writing one row per model; we need to write out same number of columns for each row: find the max Nparams
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_CMF_PS1_V3.c

    r30931 r30974  
    7272        if (source->seq == -1) {
    7373            // let's write these out in S/N order
    74             sources = psArraySort (sources, pmSourceSortBySN);
     74            sources = psArraySort (sources, pmSourceSortByFlux);
    7575        } else {
    7676            sources = psArraySort (sources, pmSourceSortBySeq);
     
    284284        // recreate the peak to match (xPos, yPos) +/- (xErr, yErr)
    285285        source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE);
    286         source->peak->flux = peakFlux;
     286        source->peak->rawFlux = peakFlux;
     287        source->peak->smoothFlux = peakFlux;
    287288        source->peak->xf   = PAR[PM_PAR_XPOS]; // more accurate position
    288289        source->peak->yf   = PAR[PM_PAR_YPOS]; // more accurate position
    289290        source->peak->dx   = dPAR[PM_PAR_XPOS];
    290291        source->peak->dy   = dPAR[PM_PAR_YPOS];
    291         if (isfinite (source->errMag) && (source->errMag > 0.0)) {
    292           source->peak->SN = 1.0 / source->errMag;
    293         } else {
    294           source->peak->SN = sqrt(source->peak->flux); // an alternate proxy: various functions sort by peak S/N
    295         }
     292
     293        // we no longer sort by S/N, only flux
     294        // if (isfinite (source->errMag) && (source->errMag > 0.0)) {
     295        //   source->peak->SN = 1.0 / source->errMag;
     296        // } else {
     297        //   source->peak->SN = sqrt(source->peak->flux); // an alternate proxy: various functions sort by peak S/N
     298        // }
    296299
    297300        source->pixWeightNotBad = psMetadataLookupF32 (&status, row, "PSF_QF");
     
    380383
    381384    // let's write these out in S/N order
    382     sources = psArraySort (sources, pmSourceSortBySN);
     385    sources = psArraySort (sources, pmSourceSortByFlux);
    383386
    384387    table = psArrayAllocEmpty (sources->n);
     
    552555
    553556    // let's write these out in S/N order
    554     sources = psArraySort (sources, pmSourceSortBySN);
     557    sources = psArraySort (sources, pmSourceSortByFlux);
    555558
    556559    // we are writing one row per model; we need to write out same number of columns for each row: find the max Nparams
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_PS1_CAL_0.c

    r30621 r30974  
    9191
    9292    // let's write these out in S/N order
    93     sources = psArraySort (sources, pmSourceSortBySN);
     93    sources = psArraySort (sources, pmSourceSortByFlux);
    9494
    9595    table = psArrayAllocEmpty (sources->n);
     
    136136
    137137        float calMag = source->psfMag + magOffset;
    138         float peakMag = (source->peak->flux > 0) ? -2.5*log10(source->peak->flux) : NAN;
     138        float peakMag = (source->peak->rawFlux > 0) ? -2.5*log10(source->peak->rawFlux) : NAN;
    139139        psS16 nImageOverlap = 1;
    140140
     
    294294
    295295        source->peak       = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE);
    296         source->peak->flux = peakFlux;
     296        source->peak->rawFlux = peakFlux;
     297        source->peak->smoothFlux = peakFlux;
    297298        source->peak->dx   = dPAR[PM_PAR_XPOS];
    298299        source->peak->dy   = dPAR[PM_PAR_YPOS];
     
    357358
    358359    // let's write these out in S/N order
    359     sources = psArraySort (sources, pmSourceSortBySN);
     360    sources = psArraySort (sources, pmSourceSortByFlux);
    360361
    361362    table = psArrayAllocEmpty (sources->n);
     
    576577
    577578    // let's write these out in S/N order
    578     sources = psArraySort (sources, pmSourceSortBySN);
     579    sources = psArraySort (sources, pmSourceSortByFlux);
    579580
    580581    // we are writing one row per model; we need to write out same number of columns for each row: find the max Nparams
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_PS1_DEV_0.c

    r30621 r30974  
    101101        }
    102102
    103         float peakMag = (source->peak->flux > 0) ? -2.5*log10(source->peak->flux) : NAN;
     103        float peakMag = (source->peak->rawFlux > 0) ? -2.5*log10(source->peak->rawFlux) : NAN;
    104104        psS16 nImageOverlap = 1;
    105105        psS32 ID = 0; // XXX need to figure out how to generate this
     
    220220
    221221        source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE);
    222         source->peak->flux = peakFlux;
     222        source->peak->rawFlux = peakFlux;
     223        source->peak->smoothFlux = peakFlux;
    223224        source->peak->dx   = dPAR[PM_PAR_XPOS];
    224225        source->peak->dy   = dPAR[PM_PAR_YPOS];
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_PS1_DEV_1.c

    r30621 r30974  
    7373
    7474    // let's write these out in S/N order
    75     sources = psArraySort (sources, pmSourceSortBySN);
     75    sources = psArraySort (sources, pmSourceSortByFlux);
    7676
    7777    table = psArrayAllocEmpty (sources->n);
     
    117117        }
    118118
    119         float peakMag = (source->peak->flux > 0) ? -2.5*log10(source->peak->flux) : NAN;
     119        float peakMag = (source->peak->rawFlux > 0) ? -2.5*log10(source->peak->rawFlux) : NAN;
    120120        psS16 nImageOverlap = 1;
    121121
     
    263263
    264264        source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE);
    265         source->peak->flux = peakFlux;
     265        source->peak->rawFlux = peakFlux;
     266        source->peak->smoothFlux = peakFlux;
    266267        source->peak->dx   = dPAR[PM_PAR_XPOS];
    267268        source->peak->dy   = dPAR[PM_PAR_YPOS];
     
    307308
    308309    // let's write these out in S/N order
    309     sources = psArraySort (sources, pmSourceSortBySN);
     310    sources = psArraySort (sources, pmSourceSortByFlux);
    310311
    311312    table = psArrayAllocEmpty (sources->n);
     
    480481
    481482    // let's write these out in S/N order
    482     sources = psArraySort (sources, pmSourceSortBySN);
     483    sources = psArraySort (sources, pmSourceSortByFlux);
    483484
    484485    // we are writing one row per model; we need to write out same number of columns for each row: find the max Nparams
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_RAW.c

    r29004 r30974  
    126126                 source[0].apMag, source[0].type, source[0].mode,
    127127                 logChi, logChiNorm,
    128                  source[0].peak->SN,
     128                 source[0].peak->rawFlux,
    129129                 source[0].apRadius,
    130130                 source[0].pixWeightNotBad,
     
    188188                 log10(model[0].chisq/model[0].nDOF),
    189189                 log10(model[0].chisqNorm/model[0].nDOF),
    190                  source[0].peak->SN,
     190                 source[0].peak->rawFlux,
    191191                 source[0].apRadius,
    192192                 source[0].pixWeightNotBad,
     
    234234
    235235        fprintf (f, "%5d %5d  %7.1f  %7.1f %7.1f  %6.3f %6.3f  %8.1f %7.1f %7.1f %7.1f  %4d %2d\n",
    236                  source->peak->x, source->peak->y, source->peak->value,
     236                 source->peak->x, source->peak->y, source->peak->detValue,
    237237                 moment->Mx, moment->My,
    238238                 moment->Mxx, moment->Myy,
     
    270270            continue;
    271271        fprintf (f, "%5d %5d  %8.1f  %7.1f %7.1f  %6.3f %6.3f  %10.1f %7.1f %7.1f %7.1f  %4d %2d %#5x\n",
    272                  source->peak->x, source->peak->y, source->peak->value,
     272                 source->peak->x, source->peak->y, source->peak->detValue,
    273273                 source->moments->Mx, source->moments->My,
    274274                 source->moments->Mxx, source->moments->Myy,
     
    299299            continue;
    300300        fprintf (f, "%5d %5d  %7.1f %7.2f %7.2f %7.2f\n",
    301                  peak->x, peak->y, peak->value, peak->SN, peak->xf, peak->yf);
    302     }
    303     fclose (f);
    304     return true;
    305 }
    306 
     301                 peak->x, peak->y, peak->detValue, peak->rawFlux, peak->xf, peak->yf);
     302    }
     303    fclose (f);
     304    return true;
     305}
     306
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceIO_SMPDATA.c

    r30621 r30974  
    205205
    206206        source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE);
    207         source->peak->flux = peakFlux;
     207        source->peak->rawFlux = peakFlux;
    208208
    209209        sources->data[i] = source;
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceMoments.c

    r30865 r30974  
    330330
    331331    psTrace ("psModules.objects", 3, "peak %f %f (%f = %f) Mx: %f  My: %f  Sum: %f  Mxx: %f  Mxy: %f  Myy: %f  sky: %f  Npix: %d\n",
    332              source->peak->xf, source->peak->yf, source->peak->flux, source->peak->SN, source->moments->Mx,   source->moments->My, Sum, source->moments->Mxx,   source->moments->Mxy,   source->moments->Myy, sky, source->moments->nPixels);
     332             source->peak->xf, source->peak->yf, source->peak->rawFlux, sqrt(source->peak->detValue), source->moments->Mx,   source->moments->My, Sum, source->moments->Mxx,   source->moments->Mxy,   source->moments->Myy, sky, source->moments->nPixels);
    333333
    334334    return(true);
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmSourceOutputs.c

    r30935 r30974  
    143143
    144144    outputs->calMag = isfinite(magOffset) ? source->psfMag + magOffset : NAN;
    145     outputs->peakMag = (source->peak->flux > 0) ? -2.5*log10(source->peak->flux) : NAN;
     145    outputs->peakMag = (source->peak->rawFlux > 0) ? -2.5*log10(source->peak->rawFlux) : NAN;
    146146
    147147    psSphere ptSky = {0.0, 0.0, 0.0, 0.0};
  • branches/eam_branches/ipp-20110213/psModules/test/objects/tap_pmPeaks.c

    r15985 r30974  
    650650    ok(test_pmPeaksInImage(TST02_NUM_ROWS, 2*TST02_NUM_COLS),
    651651      "Tested pmPeaksInImage() on (%d, %d) image", TST02_NUM_ROWS, 2*TST02_NUM_COLS);
    652 
    653 
    654     // ------------------------------------------------------------------------
    655     // Test pmPeaksSubset()
    656     // Calling pmPeaksSubset with NULL psList.  Should generate error.
    657     {
    658         psMemId id = psMemGetId();
    659         psArray *outData = pmPeaksSubset(NULL, 0.0, psRegionSet(0, 0, 0, 0));
    660         ok(outData == NULL, "pmPeaksSubset() returned a NULL with a NULL psArray input");
    661         psFree(outData);
    662         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    663     }
    664 
    665 
    666     // Set peaks in input image.  All even-column and even-row pixels are
    667     // set non-zero, all other pixels are set to zero.
    668     psImage *imgData = psImageAlloc(NUM_COLS, NUM_ROWS, PS_TYPE_F32);
    669     psS32 numPeaksOrig = 0;
    670     for (psS32 i = 0 ; i < NUM_ROWS ; i++) {
    671         for (psS32 j = 0 ; j < NUM_COLS ; j++) {
    672             if ((0 == i%2) && (0 == j%2)) {
    673                 imgData->data.F32[i][j] = (float) (i + 10);
    674                 numPeaksOrig++;
    675             } else {
    676                 imgData->data.F32[i][j] = 0.0;
    677             }
    678         }
    679     }
    680     // Call pmPeaksSubset() with large maxValue and disjoint psRegion.
    681     // Should not remove any peaks.
    682     {
    683         psMemId id = psMemGetId();
    684         psArray *outData = pmPeaksInImage(imgData, 0.0);
    685         psArray *outData2 = pmPeaksSubset(outData, PS_MAX_F32, psRegionSet(20, 20, 20, 20));
    686         ok(outData2 != NULL && psMemCheckArray(outData),
    687            "pmPeaksSubset() returned a non-NULL psArray (large maxValue)");
    688         ok(outData2->n == numPeaksOrig,
    689           "pmPeaksSubset() returned correct number of peaks (was %d, should be %d)", outData2->n+1, numPeaksOrig);
    690         psFree(outData);
    691         psFree(outData2);
    692         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    693     }
    694 
    695 
    696     // Call pmPeaksSubset() with small maxValue and disjoint psRegion.
    697     // Should not remove any peaks.
    698     {
    699         psMemId id = psMemGetId();
    700         psArray *outData = pmPeaksInImage(imgData, 0.0);
    701         psArray *outData2 = pmPeaksSubset(outData, 0.0, psRegionSet(20, 20, 20, 20));
    702         ok(outData2 != NULL && psMemCheckArray(outData),
    703            "pmPeaksSubset() returned a non-NULL psArray (small maxValue)");
    704         ok(outData2->n == 0,
    705           "pmPeaksSubset() returned correct number of peaks (was %d, should be %d)", outData2->n, 0);
    706         psFree(outData);
    707         psFree(outData2);
    708         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    709     }
    710 
    711 
    712     // Call pmPeaksSubset() with large maxValue and enclosing psRegion.
    713     // Should remove aall peaks.
    714     {
    715         psMemId id = psMemGetId();
    716         psArray *outData = pmPeaksInImage(imgData, 0.0);
    717         psRegion tmpRegion = psRegionSet(-PS_MAX_F32, PS_MAX_F32, -PS_MAX_F32, PS_MAX_F32);
    718         psArray *outData2 = pmPeaksSubset(outData, PS_MAX_F32, tmpRegion);
    719         ok(outData2 != NULL && psMemCheckArray(outData),
    720            "pmPeaksSubset() returned a non-NULL psArray (small maxValue, enclosing psRegion)");
    721         ok(outData2->n == 0,
    722           "pmPeaksSubset() returned correct number of peaks (was %d, should be %d)", outData2->n, 0);
    723         psFree(outData);
    724         psFree(outData2);
    725         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    726     }
    727 
    728 
    729     // Call pmPeaksSubset() with large maxValue and enclosing psRegion.
    730     // Should remove aall peaks.
    731     {
    732         psMemId id = psMemGetId();
    733         psArray *outData = pmPeaksInImage(imgData, 0.0);
    734         psRegion tmpRegion = psRegionSet(-PS_MAX_F32, PS_MAX_F32, -PS_MAX_F32, PS_MAX_F32);
    735         psArray *outData2 = pmPeaksSubset(outData, 0.0, tmpRegion);
    736         ok(outData2 != NULL && psMemCheckArray(outData),
    737            "pmPeaksSubset() returned a non-NULL psArray (small maxValue, inclusive psRegion)");
    738         ok(outData2->n == 0,
    739           "pmPeaksSubset() returned correct number of peaks (was %d, should be %d)", outData2->n, 0);
    740         psFree(outData);
    741         psFree(outData2);
    742         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    743     }
    744652}
  • branches/eam_branches/ipp-20110213/psModules/test/objects/tap_pmSource.c

    r24580 r30974  
    2121        pmSourceCacheModel()
    2222        pmSourceCachePSF()
    23         pmSourceSortBySN()      (COMPILER ERRORS)
     23        pmSourceSortByFlux()    (COMPILER ERRORS)
    2424        pmSourceSortByY()       (COMPILER ERRORS)
    2525    Must test
     
    801801
    802802    // ----------------------------------------
    803     // pmSourceSortBySN() tests
    804     // int pmSourceSortBySN (const void **a, const void **b)
    805     // Call pmSourceSortBySN() with acceptable input parameters.
     803    // pmSourceSortByFlux() tests
     804    // int pmSourceSortByFlux (const void **a, const void **b)
     805    // Call pmSourceSortByFlux() with acceptable input parameters.
    806806    // XXX: We don't test with NULL input parameters since this function has no PS_ASSERTS to protect
    807807    // against that.
     
    816816        src2->peak->SN = 20.0;
    817817
    818         int rc = pmSourceSortBySN((const void **) &src1, (const void **) &src2);
    819         ok(rc == 1, "pmSourceSortBySN() returned correct result (source1 < source2) (%d)", rc);
    820         rc = pmSourceSortBySN((const void **) &src2, (const void **) &src1);
    821         ok(rc == -1, "pmSourceSortBySN() returned correct result (source2 < source1) (%d)", rc);
    822         rc = pmSourceSortBySN((const void **) &src1, (const void **) &src1);
    823         ok(rc == 0, "pmSourceSortBySN() returned correct result (source1 == source2) (%d)", rc);
     818        int rc = pmSourceSortByFlux((const void **) &src1, (const void **) &src2);
     819        ok(rc == 1, "pmSourceSortByFlux() returned correct result (source1 < source2) (%d)", rc);
     820        rc = pmSourceSortByFlux((const void **) &src2, (const void **) &src1);
     821        ok(rc == -1, "pmSourceSortByFlux() returned correct result (source2 < source1) (%d)", rc);
     822        rc = pmSourceSortByFlux((const void **) &src1, (const void **) &src1);
     823        ok(rc == 0, "pmSourceSortByFlux() returned correct result (source1 == source2) (%d)", rc);
    824824
    825825        psFree(src1);
Note: See TracChangeset for help on using the changeset viewer.