Changeset 29543 for trunk/psModules/src/imcombine/pmSubtractionVisual.c
- Timestamp:
- Oct 25, 2010, 2:45:41 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmSubtractionVisual.c
r29004 r29543 146 146 } 147 147 pmVisualScaleImage(kapa1, canvas, "Subtraction_Stamps", 0, true); 148 psFree(canvas); 148 149 149 150 pmVisualAskUser(&plotStamps); … … 152 153 153 154 /** Plot the least-squares matrix of each stamp */ 154 bool pmSubtractionVisualPlotLeastSquares (pmSubtractionStampList *stamps , bool dual) {155 bool pmSubtractionVisualPlotLeastSquares (pmSubtractionStampList *stamps) { 155 156 156 157 if (!pmVisualTestLevel("ppsub.chisq", 1)) return true; … … 209 210 pmVisualScaleImage(kapa1, canvas32, "Least_Squares", 0, true); 210 211 212 if (0) { 213 static int count = 0; 214 char filename[64]; 215 sprintf (filename, "chisq.%02d.fits", count); 216 count ++; 217 psFits *fits = psFitsOpen (filename, "w"); 218 psFitsWriteImage (fits, NULL, canvas32, 0, NULL); 219 psFitsClose (fits); 220 } 221 211 222 pmVisualAskUser(&plotLeastSquares); 212 223 psFree(canvas); … … 271 282 } 272 283 } 273 fprintf (stderr, "kernel %d, sum %f\n", i, sum);284 // fprintf (stderr, "kernel %d, sum %f\n", i, sum); 274 285 } 275 286 276 287 pmVisualScaleImage(kapa1, output, "Image", 0, true); 288 psFree(output); 277 289 pmVisualAskUser(&plotImage); 278 290 return true; … … 286 298 return false; 287 299 } 300 301 // XXX clear the overlay(s) (red at least!) 288 302 289 303 // get the kernel sizes … … 297 311 if (!isfinite(stamp->flux)) continue; 298 312 if (!stamp->convolutions1 && !stamp->convolutions2) continue; 313 // fprintf (stderr, "flux: %f, maxFlux: %f ", stamp->flux, maxFlux); 299 314 if (!maxStamp) { 300 315 maxFlux = stamp->flux; 301 316 maxStamp = stamp; 317 // fprintf (stderr, "maxStamp %d\n", i); 302 318 continue; 319 } else { 320 // fprintf (stderr, "\n"); 303 321 } 304 322 if (stamp->flux > maxFlux) { … … 337 355 338 356 double sum = 0.0; 357 double sum2 = 0.0; 339 358 for (int y = -footprint; y <= footprint; y++) { 340 359 for (int x = -footprint; x <= footprint; x++) { 341 360 output->data.F32[y + yPix][x + xPix] = kernel->kernel[y][x]; 342 361 sum += kernel->kernel[y][x]; 362 sum2 += PS_SQR(kernel->kernel[y][x]); 343 363 } 344 364 } 345 fprintf (stderr, "kernel %d, sum %f\n", i, sum);365 // fprintf (stderr, "kernel %d, sum %f, sum2: %e\n", i, sum, sum2); 346 366 } 347 367 pmVisualScaleImage(kapa2, output, "Image", 0, true); 348 } 368 369 if (0) { 370 psFits *fits = psFitsOpen("basis.1.fits", "w"); 371 psFitsWriteImage(fits, NULL, output, 0, NULL); 372 psFitsClose(fits); 373 } 374 } 349 375 350 376 if (maxStamp->convolutions2) { … … 371 397 372 398 double sum = 0.0; 399 double sum2 = 0.0; 373 400 for (int y = -footprint; y <= footprint; y++) { 374 401 for (int x = -footprint; x <= footprint; x++) { 375 402 output->data.F32[y + yPix][x + xPix] = kernel->kernel[y][x]; 376 403 sum += kernel->kernel[y][x]; 404 sum2 += PS_SQR(kernel->kernel[y][x]); 377 405 } 378 406 } 379 fprintf (stderr, "kernel %d, sum %f\n", i, sum);407 // fprintf (stderr, "kernel %d, sum %f, sum2: %e\n", i, sum, sum2); 380 408 } 381 409 pmVisualScaleImage(kapa2, output, "Image", 1, true); 410 411 if (0) { 412 psFits *fits = psFitsOpen("basis.2.fits", "w"); 413 psFitsWriteImage(fits, NULL, output, 0, NULL); 414 psFitsClose(fits); 415 } 416 psFree(output); 382 417 } 383 418 … … 676 711 psFree (x); 677 712 psFree (y); 713 psFree (polyValues); 678 714 679 715 pmVisualAskUser(NULL);
Note:
See TracChangeset
for help on using the changeset viewer.
