IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13429


Ignore:
Timestamp:
May 18, 2007, 4:26:17 AM (19 years ago)
Author:
rhl
Message:

Fix memory leak and use new psEllipsePolToAxes API. psphotPSFstats fails, not aborts, with bad PSFs to allow recovery

File:
1 edited

Legend:

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

    r13225 r13429  
    196196    if (!psphotMakeResiduals (try->sources, recipe, try->psf)) {
    197197        psError(PSPHOT_ERR_PSF, false, "Unable to construct residual table for PSF");
     198        psFree (models);
    198199        return NULL;
    199200    }
     
    244245
    245246            psEllipseAxes axes1 = psEllipseShapeToAxes (shape, 20.0);
    246             psEllipseAxes axes2 = psEllipsePolToAxes (pol, 0.1);
     247            psEllipseAxes axes2;
     248            (void)psEllipsePolToAxes(pol, 0.1, &axes2);
    247249            psEllipsePol pol2 = psEllipseAxesToPol (axes1);
    248250
     
    275277    psFree (models);
    276278
    277     if (!psphotPSFstats (readout, recipe, psf)) psAbort("cannot measure PSF shape terms");
     279    if (!psphotPSFstats (readout, recipe, psf)) {
     280        psError(PSPHOT_ERR_PSF, false, "cannot measure PSF shape terms");
     281        psFree(psf);
     282        return NULL;
     283    }
    278284
    279285    modelName = pmModelGetType (psf->type);
     
    308314    // construct a PSF model at this coordinate
    309315    pmModel *modelPSF = pmModelFromPSF (modelEXT, psf);
    310     PS_ASSERT_PTR_NON_NULL(modelPSF, false);
     316    if (modelPSF == NULL) {
     317        psError(PSPHOT_ERR_PSF, false, "Failed to estimate PSF model at image centre");
     318        psFree(modelEXT);
     319        return false;
     320    }
    311321
    312322    // get the correct model-radius function
Note: See TracChangeset for help on using the changeset viewer.