IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24589 for trunk/psphot/src


Ignore:
Timestamp:
Jun 25, 2009, 3:53:04 PM (17 years ago)
Author:
eugene
Message:

add options to pass gaussian windowing and S/N clipping parameters to pmSourceMoments

File:
1 edited

Legend:

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

    r23219 r24589  
    8989
    9090            if (!psThreadJobAddPending(job)) {
    91                 psError(PS_ERR_UNKNOWN, false, "Unable to guess model.");
     91                psError(PS_ERR_UNKNOWN, false, "Unable to launch thread job PSPHOT_SOURCE_STATS");
    9292                psFree (job);
    9393                return NULL;
    9494            }
    9595            psFree(job);
    96 
    97 # if (0)
    98                 int nfail = 0;
    99                 int nmoments = 0;
    100                 if (!psphotSourceStats_Unthreaded (&nfail, &nmoments, cells->data[j], recipe)) {
    101                     psError(PS_ERR_UNKNOWN, false, "Unable to guess model.");
    102                     return NULL;
    103                 }
    104                 Nfail += nfail;
    105                 Nmoments += nmoments;
    106 # endif
    10796        }
    10897
    10998        // wait for the threads to finish and manage results
    11099        if (!psThreadPoolWait (false)) {
    111             psError(PS_ERR_UNKNOWN, false, "Unable to guess model.");
     100            psError(PS_ERR_UNKNOWN, false, "Failure in thread job PSPHOT_SOURCE_STATS");
    112101            return NULL;
    113102        }
     
    149138    psMetadata *recipe              = job->args->data[1];
    150139
    151     float INNER    = psMetadataLookupF32 (&status, recipe, "SKY_INNER_RADIUS");
    152     if (!status) return false;
    153     float MIN_SN   = psMetadataLookupF32 (&status, recipe, "MOMENTS_SN_MIN");
    154     if (!status) return false;
    155     float RADIUS   = psMetadataLookupF32 (&status, recipe, "PSF_MOMENTS_RADIUS");
     140    float INNER        = psMetadataLookupF32 (&status, recipe, "SKY_INNER_RADIUS");
     141    if (!status) return false;
     142    float MIN_SN       = psMetadataLookupF32 (&status, recipe, "MOMENTS_SN_MIN");
     143    if (!status) return false;
     144    float RADIUS       = psMetadataLookupF32 (&status, recipe, "PSF_MOMENTS_RADIUS");
     145    if (!status) return false;
     146    float MIN_PIXEL_SN = psMetadataLookupF32 (&status, recipe, "MOMENTS_MIN_PIXEL_SN");
     147    if (!status) return false;
     148    float SIGMA        = psMetadataLookupF32 (&status, recipe, "MOMENTS_GAUSS_SIGMA");
    156149    if (!status) return false;
    157150
     
    202195
    203196        // measure basic source moments
    204         status = pmSourceMoments (source, RADIUS);
     197        status = pmSourceMoments (source, RADIUS, SIGMA, MIN_PIXEL_SN);
    205198        if (status) {
    206199            Nmoments ++;
     
    212205        BIG_RADIUS = PS_MIN (INNER, 3*RADIUS);
    213206        psTrace ("psphot", 4, "retrying moments for %d, %d\n", source->peak->x, source->peak->y);
    214         status = pmSourceMoments (source, BIG_RADIUS);
     207        status = pmSourceMoments (source, BIG_RADIUS, 3.0*SIGMA, MIN_PIXEL_SN);
    215208        if (status) {
    216209            source->mode |= PM_SOURCE_MODE_BIG_RADIUS;
     
    292285
    293286        // measure basic source moments
    294         status = pmSourceMoments (source, RADIUS);
     287        status = pmSourceMoments (source, RADIUS, SIGMA, MIN_PIXEL_SN);
    295288        if (status) {
    296289            Nmoments ++;
     
    302295        BIG_RADIUS = PS_MIN (INNER, 3*RADIUS);
    303296        psTrace ("psphot", 4, "retrying moments for %d, %d\n", source->peak->x, source->peak->y);
    304         status = pmSourceMoments (source, BIG_RADIUS);
     297        status = pmSourceMoments (source, BIG_RADIUS, 3.0*SIGMA, MIN_PIXEL_SN);
    305298        if (status) {
    306299            Nmoments ++;
Note: See TracChangeset for help on using the changeset viewer.