Changeset 21363 for trunk/psModules/src/imcombine/pmSubtractionParams.c
- Timestamp:
- Feb 5, 2009, 4:31:25 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmSubtractionParams.c
r18287 r21363 71 71 double *sumII, // Sum of I(x)^2/sigma(x)^2 72 72 double *sumIC, // Sum of I(x)conv(x)/sigma(x)^2 73 const pmSubtractionStamp *stamp, // Stamp with weight73 const pmSubtractionStamp *stamp, // Stamp with variance 74 74 const psKernel *target, // Target stamp 75 75 int kernelIndex, // Index for kernel component … … 78 78 ) 79 79 { 80 psKernel * weight = stamp->weight; // Weight, sigma(x)^280 psKernel *variance = stamp->variance; // Variance, sigma(x)^2 81 81 psKernel *convolution = selectConvolution(stamp, kernelIndex, mode); // Convolution of interest 82 82 83 83 for (int y = -footprint; y <= footprint; y++) { 84 84 psF32 *in = &target->kernel[y][-footprint]; // Dereference input 85 psF32 *wt = & weight->kernel[y][-footprint]; // Dereference weight85 psF32 *wt = &variance->kernel[y][-footprint]; // Dereference variance 86 86 psF32 *conv = &convolution->kernel[y][-footprint]; // Dereference convolution 87 87 for (int x = -footprint; x <= footprint; x++, in++, wt++, conv++) { … … 98 98 static void accumulateConvolutions(double *sumC, // Sum of conv(x)/sigma(x)^2 99 99 double *sumCC, // Sum of conv(x)^2/sigma(x)^2 100 const pmSubtractionStamp *stamp, // Stamp with input and weight100 const pmSubtractionStamp *stamp, // Stamp with input and variance 101 101 int kernelIndex, // Index for kernel component 102 102 int footprint, // Size of region of interest … … 104 104 ) 105 105 { 106 psKernel * weight = stamp->weight; // Weight, sigma(x)^2106 psKernel *variance = stamp->variance; // Variance, sigma(x)^2 107 107 psKernel *convolution = selectConvolution(stamp, kernelIndex, mode); // Convolution of interest 108 108 109 109 for (int y = -footprint; y <= footprint; y++) { 110 psF32 *wt = & weight->kernel[y][-footprint]; // Dereference weight110 psF32 *wt = &variance->kernel[y][-footprint]; // Dereference variance 111 111 psF32 *conv = &convolution->kernel[y][-footprint]; // Dereference convolution 112 112 for (int x = -footprint; x <= footprint; x++, wt++, conv++) { … … 120 120 121 121 static double accumulateChi2(const psKernel *target, // Target stamp 122 pmSubtractionStamp *stamp, // Stamp with weight122 pmSubtractionStamp *stamp, // Stamp with variance 123 123 int kernelIndex, // Index for kernel component 124 124 double coeff, // Coefficient of convolution … … 129 129 { 130 130 double chi2 = 0.0; 131 psKernel * weight = stamp->weight; // Weight, sigma(x)^2131 psKernel *variance = stamp->variance; // Variance, sigma(x)^2 132 132 psKernel *convolution = selectConvolution(stamp, kernelIndex, mode); // Convolution of interest 133 133 134 134 for (int y = -footprint; y <= footprint; y++) { 135 135 psF32 *in = &target->kernel[y][-footprint]; // Dereference input 136 psF32 *wt = & weight->kernel[y][-footprint]; // Dereference weight136 psF32 *wt = &variance->kernel[y][-footprint]; // Dereference variance 137 137 psF32 *conv = &convolution->kernel[y][-footprint]; // Dereference convolution 138 138 for (int x = -footprint; x <= footprint; x++, in++, wt++, conv++) { … … 146 146 // Return the initial value of chi^2 147 147 static double initialChi2(const psKernel *target, // Target stamp 148 const pmSubtractionStamp *stamp, // Stamp with weight148 const pmSubtractionStamp *stamp, // Stamp with variance 149 149 int footprint, // Size of convolution 150 150 pmSubtractionMode mode // Mode of subtraction 151 151 ) 152 152 { 153 psKernel * weight = stamp->weight; // Weightmap153 psKernel *variance = stamp->variance; // Variance map 154 154 psKernel *source; // Source stamp 155 155 switch (mode) { … … 167 167 for (int y = -footprint; y <= footprint; y++) { 168 168 psF32 *in = &target->kernel[y][-footprint]; // Dereference input 169 psF32 *wt = & weight->kernel[y][-footprint]; // Dereference weight169 psF32 *wt = &variance->kernel[y][-footprint]; // Dereference variance 170 170 psF32 *ref = &source->kernel[y][-footprint]; // Derference reference 171 171 for (int x = -footprint; x <= footprint; x++, in++, wt++, ref++) { … … 180 180 // Subtract a convolution from the input 181 181 static void subtractConvolution(psKernel *target, // Target stamp 182 const pmSubtractionStamp *stamp, // Stamp with weight182 const pmSubtractionStamp *stamp, // Stamp with variance 183 183 int kernelIndex, // Index for kernel component 184 184 float coeff, // Coefficient of subtraction … … 288 288 289 289 // This sum is invariant to the kernel 290 psKernel * weight = stamp->weight; // Weightmap for stamp290 psKernel *variance = stamp->variance; // Variance map for stamp 291 291 for (int v = -footprint; v <= footprint; v++) { 292 psF32 *wt = & weight->kernel[v][-footprint]; // Dereference weightmap292 psF32 *wt = &variance->kernel[v][-footprint]; // Dereference variance map 293 293 for (int u = -footprint; u <= footprint; u++, wt++) { 294 294 sum1 += 1.0 / *wt;
Note:
See TracChangeset
for help on using the changeset viewer.
