IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 21, 2006, 11:50:22 AM (20 years ago)
Author:
eugene
Message:

added tests for NaN results

File:
1 edited

Legend:

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

    r6900 r6949  
    1010    // save the PSF model from the Ensemble fit
    1111    pmModel *PSF = pmModelCopy (source->modelPSF);
     12    if (isnan(PSF->params->data.F32[1])) psAbort ("psphot", "nan in psf fit");
    1213
    1314    // extend source radius as needed
     
    191192    PSF = source->modelPSF;
    192193    psphotCheckRadiusPSFBlend (readout, source, PSF, 8.0);
     194    if (isnan(PSF->params->data.F32[1])) psAbort ("psphot", "nan in dbl fit");
    193195
    194196    modelSet = psArrayAlloc (2);
    195     modelSet->n = 0;
     197    // DROP modelSet->n = 0;
    196198
    197199    DBL = pmModelCopy (PSF);
     
    224226    // use the source moments, etc to guess basic model parameters
    225227    pmModel *EXT = pmSourceModelGuess (source, modelTypeEXT);
     228    // if (isnan(EXT->params->data.F32[1])) psAbort ("psphot", "nan in ext fit");
    226229
    227230    psphotCheckRadiusEXT (readout, source, EXT);
     
    229232    x = EXT->params->data.F32[2];
    230233    y = EXT->params->data.F32[3];
     234
     235    if ((source->moments->Sx < 1e-3) || (source->moments->Sx < 1e-3)) {
     236        psTrace ("psphotSourceFits", 5, "problem source: moments: %f %f\n", source->moments->Sx, source->moments->Sy);
     237    }
    231238
    232239    // fit EXT (not PSF) model (set/unset the pixel mask)
     
    251258    // save the PSF model from the Ensemble fit
    252259    pmModel *PSF = pmModelCopy (source->modelPSF);
     260    if (isnan(PSF->params->data.F32[1])) psAbort ("psphot", "nan in blend fit primary");
    253261
    254262    x = PSF->params->data.F32[2];
     
    256264
    257265    psArray *modelSet = psArrayAlloc (source->blends->n + 1);
    258     modelSet->n = 0;
     266    // DROP modelSet->n = 0;
    259267    psArrayAdd (modelSet, 16, PSF);
    260268   
    261269    psArray *sourceSet = psArrayAlloc (source->blends->n + 1);
    262     sourceSet->n = 0;
     270    // DROP sourceSet->n = 0;
    263271    psArrayAdd (sourceSet, 16, source);
    264272
     
    282290        // XXX assume local sky is 0.0?
    283291        model->params->data.F32[1] = blend->moments->Peak - blend->moments->Sky;
     292        if (isnan(model->params->data.F32[1])) psAbort ("psphot", "nan in blend fit");
    284293        model->params->data.F32[2] = blend->peak->x;
    285294        model->params->data.F32[3] = blend->peak->y;
Note: See TracChangeset for help on using the changeset viewer.