IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 29, 2005, 5:44:55 PM (21 years ago)
Author:
eugene
Message:

various psphot updates

File:
1 edited

Legend:

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

    r4642 r4901  
    1414    int   Niter = 0;
    1515
     16    psMemoryId id = psMemGetId ();
    1617    psTimerStart ("psphot");
    1718
     
    3334
    3435    for (int i = 0; i < sources->n; i++) {
     36
    3537        psSource *source = sources->data[i];
    3638
     
    3941        if (source->type == PS_SOURCE_SATURATED) continue;
    4042
    41         // do I even need to test?
    42         if (source->modelPSF != NULL) {
    43           psFree (source->modelPSF);
    44         }
    45 
    4643        // use the source moments, etc to guess basic model parameters
    47         psModel *model  = pmSourceModelGuess (source, psf->type);
     44        psModel *modelFLT  = pmSourceModelGuess (source, psf->type);
    4845
    4946        // set PSF parameters for this model
    50         model  = psModelFromPSF (model, psf);
     47        psModel *model  = psModelFromPSF (modelFLT, psf);
    5148        x = model->params->data.F32[2];
    5249        y = model->params->data.F32[3];
     50        psFree (modelFLT);
    5351
    5452        // set the fit radius based on the object flux limit and the model
     
    7270          psLogMsg ("psphot", 3, "PSF fit failed for %f, %f (%d iterations)\n", x, y, model->nIter);
    7371          source->type = PS_SOURCE_FAIL_FIT_PSF;  // better choice?
     72          psFree (model);
    7473          continue;
    7574        }
Note: See TracChangeset for help on using the changeset viewer.