IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 7, 2006, 8:52:03 PM (20 years ago)
Author:
eugene
Message:

extensive cleanup of memory handling : no more leaks!

File:
1 edited

Legend:

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

    r6056 r6379  
    11# include "psphot.h"
     2static char DEFAULT_OPTION[] = "SKYBIAS";
    23
    34// measure the aperture residual statistics
     
    6970    // APTREND options : NONE SKYBIAS XY_LIN XY_QUAD SKY_XY_LIN FULL
    7071    char *ApTrendOption = psMetadataLookupPtr (&status, config, "APTREND");
    71     if (!status) ApTrendOption = psStringCopy ("SKYBIAS");
     72    if (!status) ApTrendOption = DEFAULT_OPTION;
    7273
    7374    // 3hi/1lo sigma clipping on the rflux vs metric fit
     
    190191        psf->ApTrend  = psVectorChiClipFitPolynomial4D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, dMag, xPos, yPos, r2rflux, flux);
    191192    }
    192 
    193 # if (1)
    194     psPolynomial4D *poly = psf->ApTrend;
    195     for (int nt = 0; nt <= poly->nT; nt++) {
    196         for (int nz = 0; nz <= poly->nZ; nz++) {
    197             for (int ny = 0; ny <= poly->nY; ny++) {
    198                 for (int nx = 0; nx <= poly->nX; nx++) {
    199                     if (poly->mask[nx][ny][nz][nt]) continue;
    200                     fprintf (stderr, "%d %d %d %d : %22.15g\n", nx, ny, nz, nt, poly->coeff[nx][ny][nz][nt]);
    201                 }
    202             }
    203         }
    204     }
    205 # endif
    206193
    207194    // construct the fitted values and the residuals
     
    256243              1e6*psf->ApTrend->coeff[0][2][0][0]);
    257244
    258     // psFree (stats);
    259     // psFree (mask);
    260     // psFree (rflux);
    261     // psFree (apResid);
    262 
     245    psFree (mask);
     246    psFree (xPos);
     247    psFree (yPos);
     248    psFree (flux);
     249    psFree (r2rflux);
     250    psFree (apResid);
     251    psFree (dMag);
     252
     253    psFree (fit);
     254    psFree (resid);
     255    psFree (stats);
     256    psFree (residStats);
    263257    return true;
    264258}
Note: See TracChangeset for help on using the changeset viewer.