IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 18, 2009, 3:19:25 PM (17 years ago)
Author:
Paul Price
Message:

Better method for deciding which image to convolve: generate solutions both ways, and choose the one with the lower residuals. We save the convolutions and least-squares matrices we generate, so that they don't have to be regenerated for the winner. Looks like this works!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmSubtractionStamps.c

    r25101 r25120  
    254254        outStamp->status = inStamp->status;
    255255
    256         outStamp->image1 = psKernelCopy(inStamp->image1);
    257         outStamp->image2 = psKernelCopy(inStamp->image2);
    258         outStamp->variance = psKernelCopy(inStamp->variance);
     256        outStamp->image1 = inStamp->image1 ? psKernelCopy(inStamp->image1) : NULL;
     257        outStamp->image2 = inStamp->image2 ? psKernelCopy(inStamp->image2) : NULL;
     258        outStamp->variance = inStamp->variance ? psKernelCopy(inStamp->variance) : NULL;
    259259
    260260        if (inStamp->convolutions1) {
     
    262262            outStamp->convolutions1 = psArrayAlloc(size);
    263263            for (int j = 0; j < size; j++) {
    264                 outStamp->convolutions1->data[j] = psKernelCopy(inStamp->convolutions1->data[j]);
     264                psKernel *conv = inStamp->convolutions1->data[j]; // Convolution
     265                outStamp->convolutions1->data[j] = conv ? psKernelCopy(conv) : NULL;
    265266            }
     267        } else {
     268            outStamp->convolutions1 = NULL;
    266269        }
    267270        if (inStamp->convolutions2) {
     
    269272            outStamp->convolutions2 = psArrayAlloc(size);
    270273            for (int j = 0; j < size; j++) {
    271                 outStamp->convolutions2->data[j] = psKernelCopy(inStamp->convolutions2->data[j]);
     274                psKernel *conv = inStamp->convolutions2->data[j]; // Convolution
     275                outStamp->convolutions2->data[j] = conv ? psKernelCopy(conv) : NULL;
    272276            }
     277        } else {
     278            outStamp->convolutions2 = NULL;
    273279        }
    274280
Note: See TracChangeset for help on using the changeset viewer.