IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 7, 2007, 11:46:29 AM (18 years ago)
Author:
Paul Price
Message:

Adding experimental code to generate the envelope PSF of multiple PSFs (for stacking).

File:
1 edited

Legend:

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

    r15761 r15762  
    704704        double diff = NAN;              // Difference between iterations
    705705        psVector *vector = NULL;        // RHS for equations
     706        int iter = 0;                   // Iteration number
    706707        do {
    707708            if (!vector) {
     
    765766            // Get difference produced by iteration
    766767            diff = 0.0;
     768#if 0
    767769            psVector *sol2 = kernels->solution2; // Solution of second equation
    768770            for (int i = 0; i < numParams2; i++) {
    769                 diff += fabs(sol2->data.F64[i] - lastSol2->data.F64[i]) / sol2->data.F64[i];
     771                diff += fabs(sol2->data.F64[i] - lastSol2->data.F64[i]);
    770772            }
    771773            lastSol2 = psVectorCopy(lastSol2, sol2, PS_TYPE_F64);
     774            psTrace("psModules.imcombine", 4, "Solution iteration %d: %lf\n", iter, diff);
     775#endif
     776
     777            psVectorInit(kernels->solution2, 0.0);
     778
     779            iter++;
    772780        } while (diff > tolerance);
    773781
     
    877885            }
    878886
    879 #ifdef TESTING
    880             psImageInit(residual->image, 0.0);
    881 #endif
    882 
    883887            for (int j = 0; j < numKernels; j++) {
    884888                psKernel *conv1 = convolutions1->data[j]; // Convolution of first image
     
    890894                for (int y = - footprint; y <= footprint; y++) {
    891895                    for (int x = - footprint; x <= footprint; x++) {
    892                         residual->kernel[y][x] += conv1->kernel[y][x] * coefficient1 -
     896                        residual->kernel[y][x] += conv1->kernel[y][x] * coefficient1 +
    893897                            conv2->kernel[y][x] * coefficient2;
    894898                    }
Note: See TracChangeset for help on using the changeset viewer.