IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6964 for trunk/psphot


Ignore:
Timestamp:
Apr 22, 2006, 3:20:29 PM (20 years ago)
Author:
eugene
Message:

squashing leaks

Location:
trunk/psphot/src
Files:
5 edited

Legend:

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

    r6950 r6964  
    146146    psMetadataAdd (recipe, PS_LIST_TAIL, "ANGLE",  PS_DATA_F32 | PS_META_REPLACE, "PSF angle",           axes.theta);
    147147   
     148    psFree (modelEXT);
     149    psFree (modelPSF);
     150
    148151    return true;
    149152}
  • trunk/psphot/src/psphotCleanup.c

    r6727 r6964  
    66    psMemCheckCorruption (true);
    77    pmModelGroupCleanup ();
    8 //    psphotOutputCleanup ();
    98    psTimeFinalize ();
    109    pmConceptsDone ();
     10    pmConfigDone ();
    1111    fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, NULL, false), "psphot");
    1212    // fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, stdout, false), "psphot");
  • trunk/psphot/src/psphotParseCamera.c

    r6862 r6964  
    7575        }
    7676    }
     77    psFree (chips);
    7778
    7879    psTrace(__func__, 1, "Done with psphotParseCamera...\n");
  • trunk/psphot/src/psphotReadout.c

    r6862 r6964  
    33bool psphotReadout (pmConfig *config, pmFPAview *view) {
    44
    5     psArray     *sources  = NULL;
    6     psArray     *peaks    = NULL;
    7     pmPSF       *psf      = NULL;
    8     bool         status;
    9 
    105    // select the current recipe
    11     psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, "PSPHOT");
     6    psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, "PSPHOT");
    127
    138    // find the currently selected readout
     
    2823
    2924    // find the peaks in the image
    30     peaks = psphotFindPeaks (readout, recipe);
     25    psArray *peaks = psphotFindPeaks (readout, recipe);
    3126
    3227    // construct sources and measure basic stats
    3328    // limit moments analysis by S/N?
    34     sources = psphotSourceStats (readout, recipe, peaks);
     29    psArray *sources = psphotSourceStats (readout, recipe, peaks);
    3530
    3631    // classify sources based on moments, brightness
     
    4237
    4338    // use bright stellar objects to measure PSF
    44     psf = psphotChoosePSF (readout, sources, recipe);
     39    pmPSF *psf = psphotChoosePSF (readout, sources, recipe);
    4540    psphotPSFstats (readout, recipe, psf);
    4641
     
    7671
    7772    // save the results of the analysis
    78     status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY,    "psphot sources", sources);
    79     status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.HEADER",  PS_DATA_METADATA, "header stats", header);
    80     status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF",     PS_DATA_UNKNOWN,  "psphot psf", psf);
     73    psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY,    "psphot sources", sources);
     74    psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.HEADER",  PS_DATA_METADATA, "header stats", header);
     75    psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF",     PS_DATA_UNKNOWN,  "psphot psf", psf);
    8176
    8277    // remove internal pmFPAfiles, if created
     
    8580
    8681    // free up the local copies of the data
     82    psFree (peaks);
     83    psFree (sources);
    8784    psFree (psf);
    8885    psFree (header);
    89     psFree (sources);
    90     psFree (peaks);
    9186    return true;
    9287}
  • trunk/psphot/src/psphotSourceFits.c

    r6949 r6964  
    9595    okDBL  = psphotEvalDBL (tmpSrc, DBL->data[0]);
    9696    okDBL &= psphotEvalDBL (tmpSrc, DBL->data[1]);
     97    // XXX should I keep / save the flags set in the eval functions?
    9798
    9899    // correct first model chisqs for flux trend
     
    100101    chiTrend = psPolynomial1DEval (psf->ChiTrend, ONE->params->data.F32[1]);
    101102    ONE->chisqNorm = ONE->chisq / chiTrend;
    102     // ONE->chisqNorm = ONE->chisq;
    103103
    104104    // save chisq for double-star/galaxy comparison
     
    109109    chiTrend = psPolynomial1DEval (psf->ChiTrend, ONE->params->data.F32[1]);
    110110    ONE->chisqNorm = ONE->chisq / chiTrend;
    111     // ONE->chisqNorm = ONE->chisq;
    112 
    113     psFree (tmpSrc); // XXX should I keep / save the flags set in the eval functions?
     111
     112    psFree (tmpSrc);
    114113
    115114    if (okEXT && okDBL) {
     
    195194
    196195    modelSet = psArrayAlloc (2);
    197     // DROP modelSet->n = 0;
     196    modelSet->n = 2;
    198197
    199198    DBL = pmModelCopy (PSF);
Note: See TracChangeset for help on using the changeset viewer.