IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 5, 2006, 1:40:52 PM (20 years ago)
Author:
rhl
Message:

Handle psVectorClipFitPolynomial1D returning NULL in pmPSFtryModel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmPSFtry.c

    r8882 r9316  
    55 *  @author EAM, IfA
    66 *
    7  *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2006-09-22 12:24:38 $
     7 *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2006-10-05 23:40:52 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    216216    stats->clipIter = 3;
    217217    // linear clipped fit of ApResid to r2rflux
    218     psVectorClipFitPolynomial1D (psfTry->psf->ChiTrend, stats, mask, 1, chisq, NULL, flux);
     218    psfTry->psf->ChiTrend =
     219        psVectorClipFitPolynomial1D(psfTry->psf->ChiTrend, stats, mask, 1, chisq, NULL, flux);
     220    psLogMsg ("pmPSFtry", 4, "chisq vs flux fit: %f +/- %f\n", stats->sampleMedian, stats->sampleStdev);
     221
     222    psFree (flux);
     223    psFree (stats);
     224    psFree (mask);
     225    psFree (chisq);
     226
     227    if (psfTry->psf->ChiTrend == NULL) {
     228        psError(PS_ERR_UNKNOWN, false, "Failed to fit psf->ChiTrend");
     229        psFree(psfTry);
     230        return NULL;
     231    }
     232
    219233    for (int i = 0; i < psfTry->psf->ChiTrend->nX + 1; i++) {
    220234        psLogMsg ("pmPSFtry", 4, "chisq vs flux fit term %d: %f +/- %f\n", i, psfTry->psf->ChiTrend->coeff[i]*pow(10000, i), psfTry->psf->ChiTrend->coeffErr[i]*pow(10000,i));
    221235    }
    222     psLogMsg ("pmPSFtry", 4, "chisq vs flux fit: %f +/- %f\n", stats->sampleMedian, stats->sampleStdev);
    223     psFree (stats);
    224     psFree (flux);
    225     psFree (mask);
    226     psFree (chisq);
    227236
    228237    // XXX this function wants aperture radius for pmSourcePhotometry
Note: See TracChangeset for help on using the changeset viewer.