Changeset 25027 for branches/pap/ppStack
- Timestamp:
- Aug 7, 2009, 4:08:25 PM (17 years ago)
- Location:
- branches/pap
- Files:
-
- 5 edited
-
. (modified) (1 prop)
-
ppStack (modified) (1 prop)
-
ppStack/src/ppStackMatch.c (modified) (6 diffs)
-
ppStack/src/ppStackPhotometry.c (modified) (1 diff)
-
ppStack/src/ppStackThread.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/ppStack
- Property svn:mergeinfo deleted
-
branches/pap/ppStack/src/ppStackMatch.c
r23573 r25027 209 209 pmFPAview *view = pmFPAviewAlloc(0); // View to readout of interest 210 210 view->chip = view->cell = view->readout = 0; 211 psString filename = pmFPAfileNameFromRule(file rule->rule, file, view); // Filename of interest211 psString filename = pmFPAfileNameFromRule(file->filerule, file, view); // Filename of interest 212 212 213 213 // Read convolution kernel … … 241 241 !readImage(&readout->variance, options->varianceNames->data[index], config)) { 242 242 psError(PS_ERR_IO, false, "Unable to read previously produced image."); 243 psFree(imageName);244 psFree(maskName);245 psFree(varianceName);246 243 return false; 247 244 } 248 psFree(imageName);249 psFree(maskName);250 psFree(varianceName);251 245 252 246 psRegion *region = psMetadataLookupPtr(NULL, conv->analysis, … … 317 311 } 318 312 313 fake->mask = psImageCopy(NULL, readout->mask, PS_TYPE_IMAGE_MASK); 314 319 315 // Add the background into the target image 320 316 psImage *bgImage = stackBackgroundModel(readout, config); // Image of background … … 361 357 psFree(stampSources); 362 358 psFree(conv); 359 if (threads > 0) { 360 pmSubtractionThreadsFinalize(readout, fake); 361 } 363 362 return false; 364 363 } … … 375 374 psFree(stampSources); 376 375 psFree(conv); 376 if (threads > 0) { 377 pmSubtractionThreadsFinalize(readout, fake); 378 } 377 379 return false; 378 380 } … … 510 512 psBinaryOp(readout->variance, readout->variance, "*", psScalarAlloc(PS_SQR(norm), PS_TYPE_F32)); 511 513 } 512 514 513 515 // Ensure the background value is zero 514 516 psStats *bg = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); // Statistics for background 515 517 psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS); // Random number generator 516 518 if (!psImageBackground(bg, NULL, readout->image, readout->mask, maskVal | maskBad, rng)) { 517 psWarning("Can't measure background for image.");518 psErrorClear();519 psWarning("Can't measure background for image."); 520 psErrorClear(); 519 521 } else { 520 psLogMsg("ppStack", PS_LOG_INFO, "Correcting convolved image background by %lf (+/- %lf)", 521 psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), psStatsGetValue(bg, PS_STAT_ROBUST_STDEV)); 522 (void)psBinaryOp(readout->image, readout->image, "-", 523 psScalarAlloc(psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), PS_TYPE_F32)); 524 } 522 if (!psMetadataLookupBool(NULL, config->arguments, "PPSTACK.SKIP.BG.SUB")) { 523 psLogMsg("ppStack", PS_LOG_INFO, "Correcting convolved image background by %lf (+/- %lf)", 524 psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), psStatsGetValue(bg, PS_STAT_ROBUST_STDEV)); 525 (void)psBinaryOp(readout->image, readout->image, "-", 526 psScalarAlloc(psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), PS_TYPE_F32)); 527 } 528 } 529 525 530 526 531 // Measure the variance level for the weighting -
branches/pap/ppStack/src/ppStackPhotometry.c
r23688 r25027 94 94 psArray *sources = psMetadataLookupPtr(NULL, photRO->analysis, "PSPHOT.SOURCES"); // Sources 95 95 psMetadataAddS32(options->stats, PS_LIST_TAIL, "NUM_SOURCES", 0, 96 "Number of sources detected", sources ->n);96 "Number of sources detected", sources ? sources->n : 0); 97 97 psMetadataAddF32(options->stats, PS_LIST_TAIL, "TIME_PHOT", 0, 98 98 "Time to do photometry", psTimerMark("PPSTACK_PHOT")); -
branches/pap/ppStack/src/ppStackThread.c
r23341 r25027 187 187 188 188 189 int zMax = 0; 189 190 bool keepReading = false; 190 if (pmReadoutMore(ro, imageFits, 0, rows, config)) {191 if (pmReadoutMore(ro, imageFits, 0, &zMax, rows, config)) { 191 192 keepReading = true; 192 if (!pmReadoutReadChunk(ro, imageFits, 0, rows, overlap, config)) {193 if (!pmReadoutReadChunk(ro, imageFits, 0, NULL, rows, overlap, config)) { 193 194 psError(PS_ERR_IO, false, "Unable to read chunk %d for file PPSTACK.INPUT %d", 194 195 numChunk, i); … … 198 199 } 199 200 200 if (pmReadoutMoreMask(ro, maskFits, 0, rows, config)) {201 if (pmReadoutMoreMask(ro, maskFits, 0, &zMax, rows, config)) { 201 202 keepReading = true; 202 if (!pmReadoutReadChunkMask(ro, maskFits, 0, rows, overlap, config)) {203 if (!pmReadoutReadChunkMask(ro, maskFits, 0, NULL, rows, overlap, config)) { 203 204 psError(PS_ERR_IO, false, "Unable to read chunk %d for file PPSTACK.INPUT.MASK %d", 204 205 numChunk, i); … … 208 209 } 209 210 210 if (pmReadoutMoreVariance(ro, varianceFits, 0, rows, config)) {211 if (pmReadoutMoreVariance(ro, varianceFits, 0, &zMax, rows, config)) { 211 212 keepReading = true; 212 if (!pmReadoutReadChunkVariance(ro, varianceFits, 0, rows, overlap, config)) {213 if (!pmReadoutReadChunkVariance(ro, varianceFits, 0, NULL, rows, overlap, config)) { 213 214 psError(PS_ERR_IO, false, 214 215 "Unable to read chunk %d for file PPSTACK.INPUT.VARIANCE %d",
Note:
See TracChangeset
for help on using the changeset viewer.
