Changeset 14733
- Timestamp:
- Sep 4, 2007, 10:11:06 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmSubtractionParams.c
r14719 r14733 212 212 for (int i = 0; i < numStamps; i++) { 213 213 pmSubtractionStamp *stamp = stamps->data[i]; // Stamp of interest 214 if (stamp->status == PM_SUBTRACTION_STAMP_REJECTED || stamp->status == PM_SUBTRACTION_STAMP_NONE) { 215 continue; 216 } 214 217 psKernel *input = stamp->input; // Input image of interest 215 218 psImage *copy = psImageCopy(NULL, input->image, PS_TYPE_F32); // Copy of the image … … 221 224 for (int i = 0; i < numStamps; i++) { 222 225 pmSubtractionStamp *stamp = stamps->data[i]; // Stamp of interest 226 if (stamp->status == PM_SUBTRACTION_STAMP_REJECTED || stamp->status == PM_SUBTRACTION_STAMP_NONE) { 227 continue; 228 } 223 229 if (!stamp->convolutions) { 224 230 stamp->convolutions = psArrayAlloc(numKernels); … … 235 241 for (int i = 0; i < numStamps; i++) { 236 242 pmSubtractionStamp *stamp = stamps->data[i]; // Stamp of interest 243 if (stamp->status == PM_SUBTRACTION_STAMP_REJECTED || stamp->status == PM_SUBTRACTION_STAMP_NONE) { 244 continue; 245 } 237 246 psKernel *weight = stamp->weight; // Weight map for stamp 238 247 … … 250 259 for (int i = 0; i < numKernels; i++) { 251 260 for (int j = 0; j < numStamps; j++) { 252 accumulateConvolutions(&sumC->data.F64[i], &sumCC->data.F64[i], stamps->data[j], i, footprint); 261 pmSubtractionStamp *stamp = stamps->data[j]; // Stamp of interest 262 if (stamp->status == PM_SUBTRACTION_STAMP_REJECTED || 263 stamp->status == PM_SUBTRACTION_STAMP_NONE) { 264 continue; 265 } 266 accumulateConvolutions(&sumC->data.F64[i], &sumCC->data.F64[i], stamp, i, footprint); 253 267 } 254 268 } … … 256 270 // Initial chi^2 257 271 double lastChi2 = 0.0; // Chi^2 from last iteration 258 int numPixels = numStamps * PS_SQR(2 * footprint + 1);// Number of pixels contributing to chi^2272 int numPixels = 0; // Number of pixels contributing to chi^2 259 273 for (int i = 0; i < numStamps; i++) { 260 lastChi2 += initialChi2(inputs->data[i], stamps->data[i], footprint); 274 pmSubtractionStamp *stamp = stamps->data[i]; // Stamp of interest 275 if (stamp->status == PM_SUBTRACTION_STAMP_REJECTED || stamp->status == PM_SUBTRACTION_STAMP_NONE) { 276 continue; 277 } 278 lastChi2 += initialChi2(inputs->data[i], stamp, footprint); 279 numPixels += PS_SQR(2 * footprint + 1); 261 280 } 262 281 lastChi2 /= numPixels; … … 282 301 283 302 for (int j = 0; j < numStamps; j++) { 284 accumulateCross(&sumI, &sumII, &sumIC, stamps->data[j], inputs->data[j], i, footprint); 303 pmSubtractionStamp *stamp = stamps->data[j]; // Stamp of interest 304 if (stamp->status == PM_SUBTRACTION_STAMP_REJECTED || 305 stamp->status == PM_SUBTRACTION_STAMP_NONE) { 306 continue; 307 } 308 accumulateCross(&sumI, &sumII, &sumIC, stamp, inputs->data[j], i, footprint); 285 309 } 286 310 … … 291 315 double chi2 = 0.0; // Chi^2 292 316 for (int j = 0; j < numStamps; j++) { 293 chi2 += accumulateChi2(inputs->data[j], stamps->data[j], i, coeff, bg, footprint); 317 pmSubtractionStamp *stamp = stamps->data[j]; // Stamp of interest 318 if (stamp->status == PM_SUBTRACTION_STAMP_REJECTED || 319 stamp->status == PM_SUBTRACTION_STAMP_NONE) { 320 continue; 321 } 322 chi2 += accumulateChi2(inputs->data[j], stamp, i, coeff, bg, footprint); 294 323 } 295 324 … … 321 350 // Remove its contribution, and don't include it in the future. 322 351 for (int j = 0; j < numStamps; j++) { 323 subtractConvolution(inputs->data[j], stamps->data[j], bestIndex, bestCoeff, bestBG, footprint); 352 pmSubtractionStamp *stamp = stamps->data[j]; // Stamp of interest 353 if (stamp->status == PM_SUBTRACTION_STAMP_REJECTED || 354 stamp->status == PM_SUBTRACTION_STAMP_NONE) { 355 continue; 356 } 357 subtractConvolution(inputs->data[j], stamp, bestIndex, bestCoeff, bestBG, footprint); 324 358 } 325 359
Note:
See TracChangeset
for help on using the changeset viewer.
