Changeset 26305 for branches/pap/ppStack/src/ppStackMatch.c
- Timestamp:
- Dec 2, 2009, 3:49:31 AM (16 years ago)
- File:
-
- 1 edited
-
branches/pap/ppStack/src/ppStackMatch.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap/ppStack/src/ppStackMatch.c
r26218 r26305 18 18 #define COVAR_FRAC 0.01 // Truncation fraction for covariance matrix 19 19 20 //#define TESTING // Enable debugging output20 #define TESTING // Enable debugging output 21 21 22 22 #ifdef TESTING … … 64 64 return; 65 65 } 66 67 #ifdef TESTING 68 static void dumpSources(const char *root, // Root name for source file 69 psArray *sources// Sources to dump 70 ) 71 { 72 static int number = 0; // Index of sources 73 psString name = NULL; // Output name 74 psStringAppend(&name, "%s_%d.sources", root, number); 75 FILE file = fopen(name, "w"); // File to write 76 psFree(name); 77 for (int i = 0; i < sources->n; i++) { 78 pmSource *source = sources->data[i]; // Source of interest 79 if (!source) { 80 continue; 81 } 82 float x, y; // Coordinates of source 83 coordsFromSource(&x, &y, source); 84 float mag = source->psfMag; // Magnitude of source 85 fprintf(file, "%f %f %f\n", x, y, mag); 86 } 87 fclose(file); 88 return; 89 } 90 #endif 91 66 92 67 93 static psArray *stackSourcesFilter(psArray *sources, // Source list to filter … … 343 369 psArray *stampSources = stackSourcesFilter(options->sourceLists->data[index], 344 370 footprint); // Filtered list of sources 345 371 #ifdef TESTING 372 dumpSources("fakeSources", stampSources); 373 #endif 346 374 if (!pmReadoutFakeFromSources(fake, readout->image->numCols, readout->image->numRows, 347 375 stampSources, SOURCE_MASK, NULL, NULL, options->psf, … … 356 384 fake->mask = psImageCopy(NULL, readout->mask, PS_TYPE_IMAGE_MASK); 357 385 386 #if 0 358 387 // Add the background into the target image 388 // XXX Is this desirable? There should be zero background on the input! 359 389 psImage *bgImage = stackBackgroundModel(readout, config); // Image of background 360 390 psBinaryOp(fake->image, fake->image, "+", bgImage); 361 391 psFree(bgImage); 392 #endif 362 393 363 394 #ifdef TESTING
Note:
See TracChangeset
for help on using the changeset viewer.
