Changeset 29599
- Timestamp:
- Oct 28, 2010, 5:51:55 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/imcombine/pmSubtraction.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmSubtraction.c
r29543 r29599 27 27 #include "pmSubtraction.h" 28 28 29 # define FFT_WINDOW 0 29 30 //#define TESTING 30 31 … … 96 97 return; 97 98 } 98 99 99 100 100 // Generate an image of the solved kernel … … 187 187 } 188 188 189 /* we have three possible implementations for handling flux conservation and photometric scaling. 190 191 1) the original implementation of Alard-Lupton subtracted the 0th kernel gaussian from 192 the rest of the kernels. the non-zero integral of the 0th kernel allows for some 193 flux re-scaling if needed. 194 195 2) the original ppSub implementation subtracted a delta function from the kernels. this 196 seems to make the solution sensitive to noise terms. 197 198 3) accept the measured flux normalization and make all kernels have zero integral, but 199 use a gaussian to zero the flux. 200 201 *** the operation below is only needed if we use option (2) *** 202 */ 203 189 204 if (normalise) { 190 205 // Put in the normalisation component 191 206 kernel->kernel[0][0] += (wantDual ? 1.0 : p_pmSubtractionSolutionNorm(kernels)); 192 207 } 193 194 208 return kernel; 195 209 } … … 243 257 psImage *subMask = mask ? psImageSubset(mask, border) : NULL; // Subimage mask 244 258 259 # if (FFT_WINDOW) 260 psImage *convolved = psImageConvolveFFTwithWindow(NULL, subImage, subMask, maskVal, kernel); // Convolution 261 # else 245 262 psImage *convolved = psImageConvolveFFT(NULL, subImage, subMask, maskVal, kernel); // Convolution 263 # endif 246 264 247 265 psFree(subImage); … … 287 305 288 306 // XXX Can trim this a little by combining the convolution: only have to take the FFT of the kernel once 307 # if (FFT_WINDOW) 308 psImage *convVariance = psImageConvolveFFTwithWindow(NULL, subVariance, subMask, maskVal, kernel); // Convolved variance 309 psImage *convKE = subKE ? psImageConvolveFFTwithWindow(NULL, subKE, subMask, maskVal, kernel) : NULL; // Conv KE 310 # else 289 311 psImage *convVariance = psImageConvolveFFT(NULL, subVariance, subMask, maskVal, kernel); // Convolved variance 290 312 psImage *convKE = subKE ? psImageConvolveFFT(NULL, subKE, subMask, maskVal, kernel) : NULL; // Conv KE 313 # endif 291 314 292 315 psFree(subVariance); … … 539 562 PS_ASSERT_KERNEL_NON_NULL(kernel, NULL); 540 563 564 # if (FFT_WINDOW) 565 psImage *conv = psImageConvolveFFTwithWindow(NULL, image->image, NULL, 0, kernel); // Convolved image 566 # else 541 567 psImage *conv = psImageConvolveFFT(NULL, image->image, NULL, 0, kernel); // Convolved image 568 # endif 542 569 543 570 // note: do not attempt to renormalize kernels here: cannot have different stars with … … 978 1005 } 979 1006 1007 // generate an image of the convolution kernel realized at the given coordinate 1008 // if 'wantDual' is set, solution2 is supplied 980 1009 psImage *pmSubtractionKernelImage(const pmSubtractionKernels *kernels, float x, float y, bool wantDual) 981 1010 { … … 1285 1314 1286 1315 psRegion *subRegion = psRegionAlloc(i, xSubMax, j, ySubMax); // Bounds of subtraction 1287 if (threaded) { 1316 // for a TEST, do not run threaded for testing 1317 // if (false && threaded) { 1318 if (threaded) { 1288 1319 psThreadJob *job = psThreadJobAlloc("PSMODULES_SUBTRACTION_CONVOLVE"); 1289 1320 psArray *args = job->args;
Note:
See TracChangeset
for help on using the changeset viewer.
