IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 3, 2011, 10:32:41 AM (15 years ago)
Author:
eugene
Message:

add several non-parametric values to extended source table; convert pmSourceIO_* functions to use autogenerated code for different formats; add optional timing marks to pmSourceFitPCM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110710/psModules/src/objects/pmSourceFitPCM.c

    r31926 r31992  
    4848// convolved model image.
    4949
     50# define TIMING 0
     51
    5052bool pmSourceFitPCM (pmPCMdata *pcm, pmSource *source, pmSourceFitOptions *fitOptions, psImageMaskType maskVal, psImageMaskType markVal, int psfSize) {
    5153   
    52     psTimerStart ("pmSourceFitPCM");
     54    if (TIMING) { psTimerStart ("pmSourceFitPCM"); }
    5355
    5456    psVector *params  = pcm->modelConv->params;
     
    6668    psImage *covar = psImageAlloc (params->n, params->n, PS_TYPE_F32);
    6769
    68     float t1 = psTimerMark ("pmSourceFitPCM");
     70    float t1, t2, t3, t4, t5;
     71    if (TIMING) { t1 = psTimerMark ("pmSourceFitPCM"); }
    6972
    7073    bool fitStatus = pmPCM_MinimizeChisq (myMin, covar, params, source, pcm);
    71     float t2 = psTimerMark ("pmSourceFitPCM");
     74    if (TIMING) { t2 = psTimerMark ("pmSourceFitPCM"); }
    7275
    7376    for (int i = 0; i < dparams->n; i++) {
     
    8285    }
    8386    psTrace ("psphot", 4, "niter: %d, chisq: %f", myMin->iter, myMin->value);
    84     float t3 = psTimerMark ("pmSourceFitPCM");
     87    if (TIMING) { t3 = psTimerMark ("pmSourceFitPCM"); }
    8588
    8689    // renormalize output model image (generated by fitting process)
     
    104107        pmSourceChisqUnsubtracted (source, pcm->modelConv, maskVal);
    105108    }
    106     float t4 = psTimerMark ("pmSourceFitPCM");
     109    if (TIMING) { t4 = psTimerMark ("pmSourceFitPCM"); }
    107110
    108111    // set the model success or failure status
     
    122125
    123126    source->mode |= PM_SOURCE_MODE_FITTED; // XXX is this needed?
    124     float t5 = psTimerMark ("pmSourceFitPCM");
     127    if (TIMING) { t5 = psTimerMark ("pmSourceFitPCM"); }
    125128
    126     if (0) {
    127         fprintf (stderr, "nIter: %2d, npix: %5d, t1: %6.4f, t2: %6.4f, t3: %6.4f, t4: %6.4f, t5: %6.4f\n", myMin->iter, pcm->nPix, t1, t2, t3, t4, t5);
    128     }
     129     if (TIMING) {
     130        fprintf (stderr, "nIter: %2d, npix: %5d, t1: %6.4f, t2: %6.4f, t3: %6.4f, t4: %6.4f, t5: %6.4f\n", myMin->iter, pcm->nPix, t1, t2, t3, t4, t5);
     131     }
    129132
    130133    psFree(myMin);
Note: See TracChangeset for help on using the changeset viewer.