IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 18, 2007, 6:38:26 PM (19 years ago)
Author:
magnier
Message:

allowing some sources to lack moments, providing stats based on SN from peaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmSource.c

    r10611 r11160  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2006-12-10 18:29:31 $
     8 *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-01-19 04:38:26 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    329329        psStats *stats  = NULL;
    330330
    331         // XXX EAM : this lets us takes the single highest peak
     331        // select the single highest peak
    332332        psArraySort (peaks, pmPeaksCompareDescend);
    333333        clump = peaks->data[0];
    334         psTrace ("psModules.objects", 2, "clump is at %d, %d (%f)\n", clump->x, clump->y, clump->counts);
     334        psTrace ("psModules.objects", 2, "clump is at %d, %d (%f)\n", clump->x, clump->y, clump->value);
    335335
    336336        // define section window for clump
     
    343343        tmpSy = psVectorAllocEmpty (sources->n, PS_TYPE_F32);
    344344
    345         // XXX clip sources based on flux?
    346345        // create vectors with Sx, Sy values in window
     346        // clip sources based on S/N
    347347        for (psS32 i = 0 ; i < sources->n ; i++)
    348348        {
    349349            pmSource *tmpSrc = (pmSource *) sources->data[i];
     350
     351            if (tmpSrc == NULL)
     352                continue;
     353            if (tmpSrc->moments == NULL)
     354                continue;
     355            if (tmpSrc->moments->SN < PSF_CLUMP_SN_LIM)
     356                continue;
    350357
    351358            if (tmpSrc->moments->Sx < minSx)
     
    380387        psTrace ("psModules.objects", 2, "clump  X,  Y: %f, %f\n", psfClump.X, psfClump.Y);
    381388        psTrace ("psModules.objects", 2, "clump DX, DY: %f, %f\n", psfClump.dX, psfClump.dY);
    382         // these values should be pushed on the recipe somewhere
    383389
    384390        psFree (stats);
     
    413419
    414420    // report stats on S/N values for star-like objects
    415     psVector *starsn = psVectorAllocEmpty (sources->n, PS_TYPE_F32);
     421    psVector *starsn_peaks = psVectorAllocEmpty (sources->n, PS_TYPE_F32);
     422    psVector *starsn_moments = psVectorAllocEmpty (sources->n, PS_TYPE_F32);
    416423
    417424    // get basic parameters, or set defaults
     
    432439
    433440        source->peak->type = 0;
     441
     442        // we are basically classifying by moments; use the default if not found
     443        if (!source->moments) {
     444            source->type = PM_SOURCE_TYPE_STAR;
     445            source->mode |= PM_SOURCE_MODE_DEFAULT;
     446            Nstar++;
     447            continue;
     448        }
    434449
    435450        psF32 sigX = source->moments->Sx;
     
    482497
    483498        // the rest are probable stellar objects
    484         starsn->data.F32[starsn->n] = source->moments->SN;
    485         starsn->n ++;
     499        starsn_moments->data.F32[starsn_moments->n] = source->moments->SN;
     500        starsn_moments->n ++;
     501        starsn_peaks->data.F32[starsn_peaks->n] = source->peak->SN;
     502        starsn_peaks->n ++;
    486503        Nstar ++;
    487504
     
    500517    }
    501518
    502     psStats *stats  = NULL;
     519    psStats *stats = NULL;
    503520    stats = psStatsAlloc (PS_STAT_MIN | PS_STAT_MAX);
    504     psVectorStats (stats, starsn, NULL, NULL, 0);
    505 
    506     psLogMsg ("pmObjects", 3, "SN range: %f - %f\n", stats[0].min, stats[0].max);
     521    psVectorStats (stats, starsn_moments, NULL, NULL, 0);
     522    psLogMsg ("pmObjects", 3, "SN range (moments): %f - %f\n", stats[0].min, stats[0].max);
     523    psFree (starsn_moments);
    507524    psFree (stats);
    508     psFree (starsn);
     525
     526    stats = psStatsAlloc (PS_STAT_MIN | PS_STAT_MAX);
     527    psVectorStats (stats, starsn_peaks, NULL, NULL, 0);
     528    psLogMsg ("pmObjects", 3, "SN range (peaks)  : %f - %f\n", stats[0].min, stats[0].max);
     529    psFree (starsn_peaks);
     530    psFree (stats);
    509531
    510532    psTrace ("psModules.objects", 2, "Nstar:    %3d\n", Nstar);
Note: See TracChangeset for help on using the changeset viewer.