IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23445


Ignore:
Timestamp:
Mar 19, 2009, 4:06:05 PM (17 years ago)
Author:
Paul Price
Message:

No need to fit if there's no sources.

File:
1 edited

Legend:

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

    r21519 r23445  
    6363        pmSource *source = sources->data[i];
    6464
    65         // turn this bit off and turn it on again if we pass this test
    66         source->mode &= ~PM_SOURCE_MODE_LINEAR_FIT;
     65        // turn this bit off and turn it on again if we pass this test
     66        source->mode &= ~PM_SOURCE_MODE_LINEAR_FIT;
    6767
    6868        // skip non-astronomical objects (very likely defects)
     
    7070        if (source->type == PM_SOURCE_TYPE_SATURATED) continue;
    7171
    72         // do not include CRs in the full ensemble fit
     72        // do not include CRs in the full ensemble fit
    7373        if (source->mode & PM_SOURCE_MODE_CR_LIMIT) continue;
    7474
     
    9494        if (y > AnalysisRegion.y1) continue;
    9595
    96         source->mode |= PM_SOURCE_MODE_LINEAR_FIT;
     96        source->mode |= PM_SOURCE_MODE_LINEAR_FIT;
    9797        psArrayAdd (fitSources, 100, source);
    9898    }
    9999    psLogMsg ("psphot.ensemble", PS_LOG_MINUTIA, "built fitSources: %f sec (%ld objects)\n", psTimerMark ("psphot.linear"), sources->n);
     100
     101    if (fitSources->n == 0) {
     102        return true;
     103    }
    100104
    101105    // vectors to store stats for each object
     
    189193    psLogMsg ("psphot.ensemble", PS_LOG_MINUTIA, "solve matrix: %f sec (%d elements)\n", psTimerMark ("psphot.linear"), sparse->Nelem);
    190194
    191     // XXXX **** philosophical question: 
     195    // XXXX **** philosophical question:
    192196    // we measure bright objects in three passes: 1) linear fit; 2) non-linear fit; 3) linear fit:
    193     // should retain the chisq and errors from the intermediate non-linear fit? 
    194     // the non-linear fit provides better values for the position errors, and for 
     197    // should retain the chisq and errors from the intermediate non-linear fit?
     198    // the non-linear fit provides better values for the position errors, and for
    195199    // extended sources, the shape errors
    196200
     
    218222    for (int i = 0; final && (i < fitSources->n); i++) {
    219223        pmSource *source = fitSources->data[i];
    220         if (source->mode & PM_SOURCE_MODE_NONLINEAR_FIT) continue;
     224        if (source->mode & PM_SOURCE_MODE_NONLINEAR_FIT) continue;
    221225        pmModel *model = pmSourceGetModel (NULL, source);
    222226        pmSourceChisq (model, source->pixels, source->maskObj, source->variance, maskVal);
Note: See TracChangeset for help on using the changeset viewer.