IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36754 for trunk/psphot/src


Ignore:
Timestamp:
May 16, 2014, 9:15:12 AM (12 years ago)
Author:
bills
Message:

skip sources with too low SN that cause the radius range to go negative

Location:
trunk/psphot/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphot.h

    r36747 r36754  
    547547bool psphotGalaxyShapeSource (pmPCMdata *pcm, pmSource *source, pmSourceGalaxyFits *galaxyFits, psImageMaskType maskVal, int psfSize, bool saveResults);
    548548psphotGalaxyShapeOptions *psphotGalaxyShapeOptionsAlloc();
    549 void psphotGalaxyShapeOptionsSet(pmSource *source, pmSourceGalaxyFits *galaxyFits, psphotGalaxyShapeOptions *defaultOptions);
     549bool psphotGalaxyShapeOptionsSet(pmSource *source, pmSourceGalaxyFits *galaxyFits, psphotGalaxyShapeOptions *defaultOptions);
    550550
    551551bool psphotRadialProfileWings (pmConfig *config, const pmFPAview *view, const char *filerule);
  • trunk/psphot/src/psphotGalaxyShape.c

    r36747 r36754  
    259259        psF32 *PAR = pcm->modelConv->params->data.F32;
    260260
    261         // double check that the guess is carried along...
     261        pmSourceGalaxyFits *galaxyFits = pmSourceGalaxyFitsAlloc();
     262
     263        // set the options for this source
     264        if (!psphotGalaxyShapeOptionsSet(source, galaxyFits, opt)) {
     265            // this source won't work
     266            psFree(pcm);
     267            psFree(galaxyFits);
     268            continue;
     269        }
     270
    262271        if (!source->galaxyFits) {
    263272            source->galaxyFits = psArrayAllocEmpty(1);
    264273        }
    265         pmSourceGalaxyFits *galaxyFits = pmSourceGalaxyFitsAlloc();
    266274        psArrayAdd(source->galaxyFits, 1, galaxyFits);
    267275        psFree(galaxyFits);
    268 
    269         // set the options for this source
    270         psphotGalaxyShapeOptionsSet(source, galaxyFits, opt);
    271276
    272277        // I have some source guess (e0, e1, e2)
     
    414419    psMemSetDeallocator(opt, (psFreeFunc) psphotGalaxyShapeOptionsFree);
    415420   
    416 #ifdef notdef
    417     opt->fRmajorMin = 0.5;
    418     opt->fRmajorMax = 2.0;
    419     opt->fRmajorDel = 0.1;
    420     opt->fRminorMin = 0.5;
    421     opt->fRminorMax = 2.0;
    422     opt->fRminorDel = 0.1;
    423     opt->snMinAllTrials = 20;      // for sources with cff SN < 20 ...
    424     opt->reduceTrialsFactor = 2; // cut the number of trials in half (double the deltas)
    425 #endif
    426 
    427421    return opt;
    428422}
    429423
    430 void psphotGalaxyShapeOptionsSet(pmSource *source, pmSourceGalaxyFits *galaxyFits, psphotGalaxyShapeOptions *options)
     424bool psphotGalaxyShapeOptionsSet(pmSource *source, pmSourceGalaxyFits *galaxyFits, psphotGalaxyShapeOptions *options)
    431425{
    432426    // XXX: put these in recipe
     
    437431    float f_min = 1 - options->NSigma * f_del;
    438432    float f_max = 1 + options->NSigma * f_del;
     433
     434    // if f_min goes negative skip this object
     435    if (f_min < 0) return false;
    439436
    440437    galaxyFits->fRmajorMin = f_min;
     
    444441    galaxyFits->fRminorMax = f_max;
    445442    galaxyFits->fRminorDel = f_del;
    446 }
    447 
     443
     444    return true;
     445}
     446
Note: See TracChangeset for help on using the changeset viewer.