Changeset 15396
- Timestamp:
- Oct 26, 2007, 1:15:06 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/imcombine/pmStack.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmStack.c
r14648 r15396 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $11 * @date $Date: 2007- 08-23 23:43:12$10 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2007-10-26 23:15:06 $ 12 12 * 13 13 * Copyright 2004-2007 Institute for Astronomy, University of Hawaii … … 221 221 for (int i = 0; i < num; i++) { 222 222 pmStackData *data = inputs->data[i]; // Stack data of interest 223 if (!data) { 224 continue; 225 } 223 226 psImage *image = data->readout->image; // Image of interest 224 227 psImage *weight = data->readout->weight; // Weight map of interest … … 292 295 // Add the pixel as one to inspect 293 296 pmStackData *data = inputs->data[j]; // Stack data of interest 297 if (!data) { 298 continue; 299 } 294 300 data->pixels = psPixelsAdd(data->pixels, PIXEL_LIST_BUFFER, x, y); 295 301 // Mask it so it's not considered in other iterations within this function … … 315 321 *num = input->n; 316 322 317 // The first is a template 318 pmStackData *data = input->data[0]; // First image off the rank 323 pmStackData *data = NULL; // First image off the rank, used as a template 324 for (int i = 0; !data && i < input->n; i++) { 325 data = input->data[i]; 326 } 319 327 PS_ASSERT_PTR_NON_NULL(data, false); 320 328 assert(psMemGetDeallocator(data) == (psFreeFunc)stackDataFree); // Ensure it's the right type … … 338 346 for (int i = 1; i < *num; i++) { 339 347 pmStackData *data = input->data[i]; // Stack data for this input 348 if (!data) { 349 continue; 350 } 340 351 assert(psMemGetDeallocator(data) == (psFreeFunc)stackDataFree); // Ensure it's the right type 341 352 if (!data->readout) { … … 469 480 for (int i = 0; i < input->n; i++) { 470 481 pmStackData *data = input->data[i]; 471 assert(data && data->pixels); 482 if (!data) { 483 continue; 484 } 485 assert(data->pixels); 472 486 psPixels *pixels = data->pixels;// The pixels of interest 473 487 for (int j = 0; j < pixels->n; j++) { … … 544 558 for (int i = 0; i < num; i++) { 545 559 pmStackData *data = input->data[i]; // Stack data for this input 560 if (!data) { 561 weights->data.F32[i] = 0.0; 562 } 546 563 weights->data.F32[i] = data->weight; 547 564 } … … 561 578 for (int i = 0; i < num; i++) { 562 579 pmStackData *data = input->data[i]; // Stacking data; contains the list of pixels 580 if (!data) { 581 continue; 582 } 563 583 pixels = psPixelsConcatenate(pixels, data->pixels); 564 584 data->pixels = psPixelsRealloc(data->pixels, PIXEL_LIST_BUFFER); // Just in case more rejection … … 596 616 for (int i = 0; i < num; i++) { 597 617 pmStackData *data = input->data[i]; // Stack data for this input 618 if (!data) { 619 continue; 620 } 598 621 data->pixels = psPixelsAllocEmpty(PIXEL_LIST_BUFFER); 599 622 } … … 611 634 for (int i = 0; i < num; i++) { 612 635 pmStackData *data = input->data[i]; // Stack data for this input 636 if (!data) { 637 continue; 638 } 613 639 psTrace("psModules.imcombine", 5, "Image %d: %ld pixels to inspect.\n", i, data->pixels->n); 614 640 }
Note:
See TracChangeset
for help on using the changeset viewer.
