IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 20, 2007, 10:34:30 AM (19 years ago)
Author:
eugene
Message:

finished PSFConvModel code; added structure to carry convolved model data

File:
1 edited

Legend:

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

    r13983 r14338  
    77// static bool  PM_SOURCE_FIT_MODEL_PIX_WEIGHTS = true;
    88
     9// input source has both modelPSF and modelEXT.  on successful exit, we set the
     10// modelConv to contain the fitted parameters, and the modelFlux to contain the
     11// convolved model image.
    912bool psphotPSFConvModel (pmSource *source, psMetadata *recipe, psMaskType maskVal) {
    1013   
    11     // XXX make sure we save a cached copy of the source psf
     14    // make sure we save a cached copy of the psf flux
     15    pmSourceCachePSF (source, maskVal);
    1216
    1317    // convert the cached cached psf model for this source to a psKernel
    14     psKernel *psf = psphotKernelFromPSF (source);
     18    // XXX for the moment, hard-wire the kernel to be 5x5 (2 pix radius)
     19    psKernel *psf = psphotKernelFromPSF (source, 2);
    1520
    1621    // generate copy of the model
     
    4853    }
    4954
     55    // set up the minimization process
    5056    psMinimization *myMin = psMinimizationAlloc (PM_SOURCE_FIT_MODEL_NUM_ITERATIONS, PM_SOURCE_FIT_MODEL_TOLERANCE);
    5157
     
    5460    bool fitStatus = psphotModelWithPSF_LMM (myMin, covar, params, constraint, source, psf, modelFunc);
    5561    for (int i = 0; i < dparams->n; i++) {
    56         if (psTraceGetLevel("psModules.objects") >= 4) {
     62        if (psTraceGetLevel("psphot") >= 4) {
    5763            fprintf (stderr, "%f ", params->data.F32[i]);
    5864        }
     
    6167        dparams->data.F32[i] = sqrt(covar->data.F32[i][i]);
    6268    }
    63     psTrace ("psModules.objects", 4, "niter: %d, chisq: %f", myMin->iter, myMin->value);
     69    psTrace ("psphot", 4, "niter: %d, chisq: %f", myMin->iter, myMin->value);
    6470
    6571    // save the resulting chisq, nDOF, nIter
     
    9197
    9298    bool retval = (onPic && fitStatus);
    93     psTrace("psModules.objects", 5, "---- %s(%d) end ----\n", __func__, retval);
     99    psTrace("psphot", 5, "---- %s(%d) end ----\n", __func__, retval);
    94100    return(retval);
    95101}
Note: See TracChangeset for help on using the changeset viewer.