Changeset 16408 for branches/pap_branch_080207/ppStack/src/ppStackLoop.c
- Timestamp:
- Feb 11, 2008, 7:09:46 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/pap_branch_080207/ppStack/src/ppStackLoop.c
r16407 r16408 10 10 11 11 #include "ppStack.h" 12 13 #define ARRAY_BUFFER 16 // Number to add to array at a time14 12 15 13 // Here follows lists of files for activation/deactivation at various stages. Each must be NULL-terminated. … … 327 325 #ifndef CONVOLVED_ALREADY 328 326 // Background subtraction, scaling and normalisation is performed automatically by the image matching 329 if (!ppStackMatch(readout, sources, targetPSF, config)) { 327 psArray *regions = NULL, *kernels = NULL; // Regions and kernels used in subtraction 328 if (!ppStackMatch(readout, ®ions, &kernels, sources, targetPSF, config)) { 330 329 psError(PS_ERR_UNKNOWN, false, "Unable to match image %d --- ignoring.", i); 331 330 psFree(sources); … … 333 332 return false; 334 333 } 334 335 subRegions->data[i] = regions; 336 subKernels->data[i] = kernels; 335 337 336 338 // Write the temporary convolved files … … 342 344 #endif 343 345 344 // Extract the regions and solutions used in the image matching345 // This stops them from being freed when we iterate back up the FPA346 psArray *regions = psArrayAllocEmpty(ARRAY_BUFFER); // Array of regions347 {348 psMetadataIterator *iter = psMetadataIteratorAlloc(readout->analysis, PS_LIST_HEAD,349 PM_SUBTRACTION_ANALYSIS_REGION); // Iterator350 psMetadataItem *item = NULL;// Item from iteration351 while ((item = psMetadataGetAndIncrement(iter))) {352 assert(item->type == PS_DATA_REGION);353 regions = psArrayAdd(regions, ARRAY_BUFFER, item->data.V);354 }355 psFree(iter);356 }357 psArray *kernels = psArrayAllocEmpty(ARRAY_BUFFER); // Array of kernels358 {359 psMetadataIterator *iter = psMetadataIteratorAlloc(readout->analysis, PS_LIST_HEAD,360 PM_SUBTRACTION_ANALYSIS_KERNEL); // Iterator361 psMetadataItem *item = NULL;// Item from iteration362 while ((item = psMetadataGetAndIncrement(iter))) {363 assert(item->type == PS_DATA_VECTOR);364 kernels = psArrayAdd(kernels, ARRAY_BUFFER, item->data.V);365 }366 psFree(iter);367 }368 assert(regions->n == kernels->n);369 370 subRegions->data[i] = regions;371 subKernels->data[i] = kernels;372 346 cells->data[i] = psMemIncrRefCounter(readout->parent); 373 374 347 filesIterateUp(config); 375 348 }
Note:
See TracChangeset
for help on using the changeset viewer.
