Changeset 18346 for trunk/ppStack/src/ppStackLoop.c
- Timestamp:
- Jun 27, 2008, 12:05:30 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackLoop.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackLoop.c
r18168 r18346 17 17 18 18 // Files required in preparation for convolution 19 static char *prepareFiles[] = { "PPSTACK.INPUT.PSF", "PPSTACK. SOURCES", NULL };19 static char *prepareFiles[] = { "PPSTACK.INPUT.PSF", "PPSTACK.INPUT.SOURCES", NULL }; 20 20 21 21 // Files required for the convolution … … 213 213 // Preparation iteration: Load the sources, and get a target PSF model 214 214 psTrace("ppStack", 1, "Determining target PSF....\n"); 215 p mReadout *sources = NULL; // Readout with sources to use for PSF matching215 psArray *sources = NULL; // Sources to use for PSF matching 216 216 pmPSF *targetPSF = NULL; // Target PSF 217 bool haveSources = psMetadataLookupBool(NULL, config->arguments, "HAVE.SOURCES"); // Global sources? 217 218 if (psMetadataLookupBool(NULL, config->arguments, "HAVE.PSF")) { 218 219 pmFPAfileActivate(config->files, false, NULL); … … 223 224 } 224 225 225 // We want to hang on to the 'sources' even when its host FPA is blown away226 sources = psMemIncrRefCounter(pmFPAfileThisReadout(config->files, view, "PPSTACK.SOURCES"));227 if (!sources) {228 psError(PS_ERR_UNKNOWN, true, "Unable to find sources.");229 psFree(view);230 return false;231 }232 233 226 // Generate list of PSFs 234 227 psMetadataIterator *fileIter = psMetadataIteratorAlloc(config->files, PS_LIST_HEAD, … … 236 229 psMetadataItem *fileItem; // Item from iteration 237 230 psArray *psfs = psArrayAlloc(num); // PSFs for PSF envelope 231 psArray *sourceLists = NULL; // Source lists for merging sources from multiple readouts 238 232 int numCols = 0, numRows = 0; // Size of image 239 233 int index = 0; // Index for file … … 247 241 psFree(view); 248 242 psFree(sources); 243 psFree(sourceLists); 249 244 psFree(fileIter); 250 245 psFree(psfs); … … 263 258 psFree(view); 264 259 psFree(sources); 260 psFree(sourceLists); 265 261 psFree(fileIter); 266 262 psFree(psfs); … … 270 266 numCols = naxis1; 271 267 numRows = naxis2; 268 } 269 270 if (!haveSources) { 271 pmReadout *ro = pmFPAviewThisReadout(view, inputFile->fpa); // Readout with sources 272 sourceLists = ppStackSourceListAdd(sourceLists, ro, config); 273 if (!sourceLists) { 274 psError(PS_ERR_UNKNOWN, false, "Unable to add sources to list."); 275 psFree(view); 276 psFree(sources); 277 psFree(fileIter); 278 psFree(psfs); 279 return false; 280 } 272 281 } 273 282 } … … 281 290 psFree(sources); 282 291 return false; 292 } 293 294 if (haveSources) { 295 // We want to hang on to the 'sources' even when its host FPA is blown away 296 sources = psMemIncrRefCounter(pmFPAfileThisReadout(config->files, view, "PPSTACK.INPUT.SOURCES")); 297 if (!sources) { 298 psError(PS_ERR_UNKNOWN, true, "Unable to find sources."); 299 psFree(view); 300 return false; 301 } 302 } else { 303 sources = ppStackSourceListCombine(sourceLists, config); 304 psFree(sourceLists); 305 if (!sources) { 306 psError(PS_ERR_UNKNOWN, false, "Unable to add sources to list."); 307 psFree(view); 308 psFree(psfs); 309 return false; 310 } 283 311 } 284 312
Note:
See TracChangeset
for help on using the changeset viewer.
