Changeset 17626
- Timestamp:
- May 9, 2008, 5:03:50 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackLoop.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackLoop.c
r17625 r17626 307 307 psArray *subRegions = psArrayAlloc(num); // Subtraction regions --- required in the stacking 308 308 psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS, 0); // Random number generator 309 int numGood = 0; // Number of good frames 309 310 for (int i = 0; i < num; i++) { 310 311 psTrace("ppStack", 2, "Convolving input %d of %d to target PSF....\n", i, num); … … 326 327 psArray *regions = NULL, *kernels = NULL; // Regions and kernels used in subtraction 327 328 if (!ppStackMatch(readout, ®ions, &kernels, sources, targetPSF, rng, config)) { 328 psError(PS_ERR_UNKNOWN, false, "Unable to match image %d --- ignoring.", i); 329 psFree(sources); 330 psFree(targetPSF); 331 psFree(rng); 332 return false; 329 psErrorStackPrint(stderr, "Unable to match image %d --- ignoring.", i); 330 psErrorClear(); 331 continue; 333 332 } 334 333 … … 345 344 cells->data[i] = psMemIncrRefCounter(readout->parent); 346 345 filesIterateUp(config); 346 numGood++; 347 347 } 348 348 psFree(sources); 349 349 psFree(targetPSF); 350 350 psFree(rng); 351 352 if (numGood == 0) { 353 psError(PS_ERR_UNKNOWN, false, "No good images to combine."); 354 return false; 355 } 351 356 352 357 … … 374 379 for (int i = 0; i < num; i++) { 375 380 pmCell *cell = cells->data[i]; // Cell of interest 381 if (!cell) { 382 // Bad image 383 continue; 384 } 376 385 pmReadout *ro = cell->readouts->data[0]; // Readout of interest 377 386 if (!ro) { … … 387 396 psArray *weightFits = psArrayAlloc(num); 388 397 for (int i = 0; i < num; i++) { 398 if (!readouts->data[i]) { 399 // Bad image 400 continue; 401 } 389 402 // Resolved names 390 403 psString imageResolved = pmConfigConvertFilename(imageNames->data[i], config, false); … … 412 425 for (int i = 0; i < num; i++) { 413 426 pmReadout *readout = readouts->data[i]; 414 assert(readout); 427 if (!readout) { 428 // Bad image 429 continue; 430 } 415 431 416 432 if (!pmReadoutReadChunk(readout, imageFits->data[i], 0, numScans, overlap) || … … 447 463 for (int i = 0; i < num && more; i++) { 448 464 pmReadout *readout = readouts->data[i]; 449 assert(readout); 465 if (!readout) { 466 // Bad image 467 continue; 468 } 450 469 more &= pmReadoutMore(readout, imageFits->data[i], 0, numScans); 451 470 more &= pmReadoutMoreMask(readout, maskFits->data[i], 0, numScans); … … 460 479 for (int i = 0; i < num; i++) { 461 480 pmReadout *ro = readouts->data[i]; // Readout of interest 481 if (!readout) { 482 // Bad image 483 numRejected++; 484 continue; 485 } 462 486 psPixels *inspect = NULL; // Inspection list for this readout 463 487 psMetadataIterator *iter = psMetadataIteratorAlloc(ro->analysis, PS_LIST_HEAD, … … 575 599 // Close up 576 600 for (int i = 0; i < num; i++) { 601 if (!readouts->data[i]) { 602 continue; 603 } 577 604 psFitsClose(imageFits->data[i]); 578 605 psFitsClose(maskFits->data[i]);
Note:
See TracChangeset
for help on using the changeset viewer.
