IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6949


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

added tests for NaN results

Location:
trunk/psphot/src
Files:
2 edited

Legend:

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

    r6900 r6949  
    2929    psArray  *models = psArrayAlloc (sources->n);
    3030    psVector *index  = psVectorAlloc (sources->n, PS_TYPE_U32);
    31     models->n = index->n = 0;
     31    // DROP models->n = index->n = 0;
    3232
    3333    // option to limit analysis to a specific region
     
    170170
    171171    psSparseConstraint constraint;
    172     constraint.paramMin   = 0;
     172    constraint.paramMin   = 0.0;
    173173    constraint.paramMax   = 1e8;
    174174    constraint.paramDelta = 1e8;
     
    191191
    192192        // assign linearly-fitted normalization
     193        if (isnan(norm->data.F32[i])) {
     194            psAbort ("psphot", "ensemble source is nan");
     195        }
    193196        Fi->modelPSF->params->data.F32[1] = norm->data.F32[i];
    194197        Fi->modelPSF->dparams->data.F32[1] = sqrt(sqrt(2) * norm->data.F32[i] / (sparse->Bfj->data.F32[i] * weight->data.F32[i]));
  • 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.