Changeset 6379 for trunk/psphot/src/psphotEnsemblePSF.c
- Timestamp:
- Feb 7, 2006, 8:52:03 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotEnsemblePSF.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotEnsemblePSF.c
r6056 r6379 1 1 # include "psphot.h" 2 2 3 // 2006.02.07 : no leaks! 4 // fit all reasonable sources with the linear PSF model 3 5 bool psphotEnsemblePSF (pmReadout *readout, psMetadata *config, psArray *sources, pmPSF *psf, psStats *sky) { 4 6 … … 6 8 float x; 7 9 float y; 10 float f; 8 11 9 12 psTimerStart ("psphot"); … … 28 31 bool UseAnalysisRegion = false; 29 32 psRegion AnalysisRegion = {0, 0, 0, 0}; 30 char *region = psMetadataLookup Ptr (&status, config, "ANALYSIS_REGION");33 char *region = psMetadataLookupStr (&status, config, "ANALYSIS_REGION"); 31 34 if (status) { 32 35 UseAnalysisRegion = true; … … 126 129 index->data.U32[models->n] = i; 127 130 psArrayAdd (models, 100, otSource); 131 psFree (otSource); 128 132 } 129 133 psLogMsg ("psphot.emsemble", 4, "built models: %f (%d objects)\n", psTimerMark ("psphot"), sources->n); 130 134 131 float f;132 133 135 // fill out the sparse matrix 134 136 psSparse *sparse = psSparseAlloc (models->n, 100); … … 173 175 pmSource *Mi = models->data[i]; 174 176 175 Fi->modelPSF = Mi->modelPSF; 177 // need to increment counter so we can free models here and sources above 178 Fi->modelPSF = psMemCopy (Mi->modelPSF); 176 179 177 180 // assign linearly-fitted normalization … … 183 186 Fi->mode |= PM_SOURCE_TEMPSUB; 184 187 } 185 186 // XXX EAM : need to free up many things here 188 psFree (index); 189 psFree (sparse); 190 psFree (models); 191 psFree (norm); 187 192 188 193 psLogMsg ("psphot.emsemble", 3, "measure ensemble of PSFs: %f sec\n", psTimerMark ("psphot"));
Note:
See TracChangeset
for help on using the changeset viewer.
