Changeset 13389
- Timestamp:
- May 15, 2007, 2:01:03 PM (19 years ago)
- Location:
- trunk/psModules/src/imcombine
- Files:
-
- 2 edited
-
pmSubtraction.c (modified) (5 diffs)
-
pmSubtractionKernels.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmSubtraction.c
r13386 r13389 4 4 * @author GLG, MHPCC 5 5 * 6 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $7 * @date $Date: 2007-05-1 5 04:33:58$6 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-05-16 00:01:03 $ 8 8 * 9 9 * Copyright 2004-2007 Institute for Astronomy, University of Hawaii … … 66 66 assert(kernels->xOrder->n == numKernels); 67 67 assert(kernels->yOrder->n == numKernels); 68 69 // Ensure the subIndex for POIS kernels is what is expected 70 assert(kernels->type != PM_SUBTRACTION_KERNEL_POIS || 71 (kernels->u->data.S32[kernels->subIndex] == 0 && kernels->v->data.S32[kernels->subIndex] == 0 && 72 kernels->xOrder->data.S32[kernels->subIndex] == 0 && 73 kernels->yOrder->data.S32[kernels->subIndex] == 0)); 68 74 69 75 int size = kernels->size; // Kernel half-size … … 82 88 int v = kernels->v->data.S32[i]; // Offset in y 83 89 kernel->kernel[v][u] += weightFunc(polyValue * solution->data.F64[i]); 90 if (i != kernels->subIndex) { 91 // The (0,0) element is subtracted from most kernels to preserve photometric scaling 92 kernel->kernel[0][0] -= weightFunc(solution->data.F64[i]); 93 } 84 94 break; 85 95 } … … 119 129 int u = kernels->u->data.S32[index]; // Offset in x 120 130 int v = kernels->v->data.S32[index]; // Offset in y 121 return weightFunc(polyValue) * image->data.F32[y + v][x + u]; 131 double value = weightFunc(polyValue) * image->data.F32[y + v][x + u]; // Value of convolution 132 if (index != kernels->subIndex) { 133 // The (0,0) element is subtracted from most kernels to preserve photometric scaling 134 value -= image->data.F32[y][x]; 135 } 136 return value; 122 137 } 123 138 case PM_SUBTRACTION_KERNEL_ISIS: { … … 243 258 convolutions->data.F64[i] = convolvePixel(kernels, i, x, y, reference, polyValues, 244 259 imageWeighting); 245 }246 247 if (spatialOrder > 0) {248 // Subtract a nominated convolution, to force flux conservation249 int subIndex = kernels->subIndex; // Index of convolution to subtract250 for (int i = 0; i < subIndex; i++) {251 convolutions->data.F64[i] -= convolutions->data.F64[subIndex];252 }253 for (int i = subIndex + 1; i < numKernels; i++) {254 convolutions->data.F64[i] -= convolutions->data.F64[subIndex];255 }256 260 } 257 261 -
trunk/psModules/src/imcombine/pmSubtractionKernels.c
r13383 r13389 168 168 } 169 169 170 // Subtract a particular kernel in order to preserve photometric calibration across image 170 171 kernels->subIndex = 0; 171 172 assert(kernels->u->data.S32[kernels->subIndex] == 0 && … … 173 174 kernels->xOrder->data.S32[kernels->subIndex] == 0 && 174 175 kernels->yOrder->data.S32[kernels->subIndex] == 0); 176 177 psKernel *subKernel = kernels->preCalc->data[kernels->subIndex]; // Kernel to subtract 178 for (int i = 0; i < kernels->subIndex; i++) { 179 psKernel *kernel = kernels->preCalc->data[i]; // Kernel of interest 180 (void)psBinaryOp(kernel->image, kernel->image, "-", subKernel->image); 181 } 182 for (int i = kernels->subIndex + 1; i < num; i++) { 183 psKernel *kernel = kernels->preCalc->data[i]; // Kernel of interest 184 (void)psBinaryOp(kernel->image, kernel->image, "-", subKernel->image); 185 } 175 186 176 187
Note:
See TracChangeset
for help on using the changeset viewer.
