IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11177


Ignore:
Timestamp:
Jan 18, 2007, 6:56:45 PM (19 years ago)
Author:
eugene
Message:

allow faint sources to skip the moments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotSourceStats.c

    r10801 r11177  
    1313    float OUTER    = psMetadataLookupF32 (&status, recipe, "SKY_OUTER_RADIUS");
    1414    float RADIUS   = psMetadataLookupF32 (&status, recipe, "PSF_MOMENTS_RADIUS");
     15    float MIN_SN   = psMetadataLookupF32 (&status, recipe, "MOMENTS_SN_MIN");
    1516    char *breakPt  = psMetadataLookupStr (&status, recipe, "BREAK_POINT");
    1617
    1718    sources = psArrayAllocEmpty (peaks->n);
    1819
     20    int Nfail = 0;
     21    int Nmoments = 0;
    1922    for (int i = 0; i < peaks->n; i++) {
    2023
     
    3134        }
    3235
    33         // XXX skip faint sources?
     36        // skip faint sources
     37        if (source->peak->SN < MIN_SN) {
     38            psArrayAdd (sources, 100, source);
     39            psFree (source);
     40            continue;
     41        }
    3442
    3543        // measure a local sky value
     
    3846        if (!status) {
    3947          psFree (source);
     48          Nfail ++;
    4049          continue;
    4150        }
     
    4655        if (!status) {
    4756          psFree (source);
     57          Nfail ++;
    4858          continue;
    4959        }
     
    5565            psArrayAdd (sources, 100, source);
    5666            psFree (source);
     67            Nmoments ++;
    5768            continue;
    5869        }
     
    6778            psArrayAdd (sources, 100, source);
    6879            psFree (source);
     80            Nmoments ++;
    6981            continue;
    7082        }
    7183
    7284        psFree (source);
     85        Nfail ++;
    7386        continue;
    7487    }
    7588
    76     psLogMsg ("psphot", PS_LOG_INFO, "%ld moments: %f sec\n", sources->n, psTimerMark ("psphot"));
     89    psLogMsg ("psphot", PS_LOG_INFO, "%ld sources, %d moments, %d failed: %f sec\n", sources->n, Nmoments, Nfail, psTimerMark ("psphot"));
    7790
    7891    return (sources);
Note: See TracChangeset for help on using the changeset viewer.