IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 24, 2011, 12:49:04 PM (15 years ago)
Author:
eugene
Message:

correct typo in logic for GuessModels; test option for large object moments (try harder); updates to visuals

File:
1 edited

Legend:

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

    r29936 r30753  
    122122        // allocate space for moments
    123123        source->moments = pmMomentsAlloc();
     124
     125        if (source->mode & PM_SOURCE_MODE_MOMENTS_FAILURE) {
     126            fprintf (stderr, "moment failure\n");
     127        }
    124128
    125129        // allocate image, weight, mask arrays for each peak (square of radius OUTER)
     
    361365
    362366    bool status = false;
    363     float BIG_RADIUS;
    364367    psScalar *scalar = NULL;
    365368
     
    415418            continue;
    416419        }
     420
     421        if (source->mode & PM_SOURCE_MODE_SATSTAR) {
     422            fprintf (stderr, "satstar: %f,%f\n", source->peak->xf, source->peak->yf);
     423        }
    417424
    418425        // measure basic source moments (no S/N clipping on input pixels)
     
    431438            psImageMaskPixels (source->maskObj, "AND", PS_NOT_IMAGE_MASK(markVal));
    432439        }           
    433         if (status) {
     440        if (status && (source->moments->Mrf < 2.0*SIGMA)) {
    434441            Nmoments ++;
    435442            continue;
    436443        }
    437444
    438         // if no valid pixels, or massive swing, likely saturated source,
     445        // if no valid pixels, massive swing or very large Mrf, likely saturated source,
    439446        // try a much larger box
    440         BIG_RADIUS = PS_MIN (INNER, 3*RADIUS);
     447        float BIG_RADIUS = 3.0*RADIUS;
     448        float BIG_SIGMA  = 3.0*SIGMA;
     449
     450        {
     451            // NOTE this is slightly sleazy, but only slightly: pmSourceRedefinePixels uses the readout
     452            // to pass the pointers to the parent image data.  I guess the API could be simplified:
     453            // we could recover this from the source in the function
     454
     455            pmReadout tmpReadout;
     456            tmpReadout.image    = (psImage *)source->pixels->parent;
     457            tmpReadout.mask     = (psImage *)source->maskView->parent;
     458            tmpReadout.variance = (psImage *)source->variance->parent;
     459
     460            // re-allocate image, weight, mask arrays for each peak (square of radius OUTER)
     461            pmSourceRedefinePixels (source, &tmpReadout, source->peak->x, source->peak->y, BIG_RADIUS + 2);
     462        }
     463
    441464        psTrace ("psphot", 4, "retrying moments for %d, %d\n", source->peak->x, source->peak->y);
    442         status = pmSourceMoments (source, BIG_RADIUS, 3.0*SIGMA, 0.0, maskVal);
     465        status = pmSourceMoments (source, BIG_RADIUS, BIG_SIGMA, 0.0, maskVal);
    443466        if (status) {
    444467            source->mode |= PM_SOURCE_MODE_BIG_RADIUS;
Note: See TracChangeset for help on using the changeset viewer.