Changeset 26690
- Timestamp:
- Jan 26, 2010, 11:22:22 PM (16 years ago)
- Location:
- branches/eam_branches/20091201/ppStack/src
- Files:
-
- 2 edited
-
ppStackConvolve.c (modified) (1 diff)
-
ppStackMatch.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20091201/ppStack/src/ppStackConvolve.c
r26475 r26690 59 59 pmFPAfileActivate(config->files, false, NULL); 60 60 ppStackFileActivationSingle(config, PPSTACK_FILES_CONVOLVE, true, i); 61 if (options->convolve) {62 // XXX PPSTACK.CONV.KERNEL not defined unless convolve63 // pmFPAfileActivate(config->files, true, "PPSTACK.CONV.KERNEL");64 pmFPAfileActivateSingle(config->files, true, "PPSTACK.CONV.KERNEL", i); // Activated file65 }61 if (options->convolve) { 62 // XXX PPSTACK.CONV.KERNEL not defined unless convolve 63 // pmFPAfileActivate(config->files, true, "PPSTACK.CONV.KERNEL"); 64 pmFPAfileActivateSingle(config->files, true, "PPSTACK.CONV.KERNEL", i); // Activated file 65 } 66 66 67 67 pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPSTACK.INPUT", i); // File of interest -
branches/eam_branches/20091201/ppStack/src/ppStackMatch.c
r26684 r26690 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 … … 274 274 PM_SUBTRACTION_ANALYSIS_KERNEL); 275 275 276 pmSubtractionAnalysis( readout->analysis, NULL, kernels, region,276 pmSubtractionAnalysis(conv->analysis, NULL, kernels, region, 277 277 readout->image->numCols, readout->image->numRows); 278 278 … … 372 372 fake->mask = psImageCopy(NULL, readout->mask, PS_TYPE_IMAGE_MASK); 373 373 374 #if 1 374 375 // Add the background into the target image 375 376 psImage *bgImage = stackBackgroundModel(readout, config); // Image of background 376 377 psBinaryOp(fake->image, fake->image, "+", bgImage); 377 378 psFree(bgImage); 379 #endif 378 380 379 381 #ifdef TESTING … … 456 458 return false; 457 459 } 458 psFree(widthsCopy);460 psFree(widthsCopy); 459 461 } 460 462 … … 559 561 } 560 562 563 // Kernel normalisation 564 { 565 double sum = 0.0; // Sum of chi^2 566 int num = 0; // Number of measurements of chi^2 567 psString regex = NULL; // Regular expression 568 psStringAppend(®ex, "^%s$", PM_SUBTRACTION_ANALYSIS_NORM); 569 psMetadataIterator *iter = psMetadataIteratorAlloc(conv->analysis, PS_LIST_HEAD, regex); 570 psFree(regex); 571 psMetadataItem *item = NULL;// Item from iteration 572 while ((item = psMetadataGetAndIncrement(iter))) { 573 assert(item->type == PS_TYPE_F32); 574 float norm = item->data.F32; // Normalisation 575 sum += norm; 576 num++; 577 } 578 psFree(iter); 579 float conv = sum/num; // Mean normalisation from convolution 580 float stars = powf(10.0, -0.4 * options->norm->data.F32[index]); // Normalisation from stars 581 float renorm = stars / conv; // Renormalisation to apply 582 psLogMsg("ppStack", PS_LOG_INFO, "Renormalising image %d by %f (kernel: %f, stars: %f)\n", 583 index, renorm, conv, stars); 584 psBinaryOp(readout->image, readout->image, "*", psScalarAlloc(renorm, PS_TYPE_F32)); 585 psBinaryOp(readout->variance, readout->variance, "*", psScalarAlloc(PS_SQR(renorm), PS_TYPE_F32)); 586 } 587 561 588 // Reject image completely if the maximum deconvolution fraction exceeds the limit 562 589 float deconv = psMetadataLookupF32(NULL, conv->analysis,
Note:
See TracChangeset
for help on using the changeset viewer.
