Changeset 9384
- Timestamp:
- Oct 6, 2006, 5:52:39 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/detrend/pmShutterCorrection.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/detrend/pmShutterCorrection.c
r9352 r9384 481 481 pmShutterCorrection *guess = pmShutterCorrectionGuess(exptimes, counts); // Guess at correction 482 482 pmShutterCorrection *corr = pmShutterCorrectionFullFit(exptimes, counts, errors, guess); // Correct'n 483 if (!corr) { 484 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to measure shutter reference correction.\n"); 485 psFree(guess); 486 psFree(counts); 487 psFree(errors); 488 goto MEASURE_ERROR; 489 } 483 490 psTrace("psModules.detrend", 5, "Sample reference value: %f\n", corr->offref); 484 491 if (isfinite(corr->offref)) { … … 508 515 // We don't have weights, so no realistic errors: turn off iteration 509 516 if (nIter > 0) { 510 psWarning("Not all images have weights --- turning weightingoff.\n");517 psWarning("Not all images have weights --- turning iteration off.\n"); 511 518 } 512 519 nIter = 1; … … 516 523 517 524 psImage *shutter = psImageAlloc(numCols, numRows, PS_TYPE_F32); // Shutter correction image 518 //psImage *pattern = psImageAlloc(numCols, numRows, PS_TYPE_F32); // Illumination pattern525 psImage *pattern = psImageAlloc(numCols, numRows, PS_TYPE_F32); // Illumination pattern 519 526 psVector *mask = psVectorAlloc(num, PS_TYPE_U8); // Mask for each image 520 527 mask->n = num; … … 541 548 nIter, rej, maskVal); 542 549 shutter->data.F32[y][x] = corr->offset; 543 //pattern->data.F32[y][x] = corr->scale;550 pattern->data.F32[y][x] = corr->scale; 544 551 psFree(corr); 545 552 } 546 553 } 554 psFree(mask); 547 555 psFree(counts); 548 556 psFree(errors); 549 557 psFree(refs); 558 559 psFits *fits = psFitsOpen("pattern.fits", "w"); 560 psFitsWriteImage(fits, NULL, pattern, 0, NULL); 561 psFitsClose(fits); 562 psFree(pattern); 550 563 551 564 return shutter;
Note:
See TracChangeset
for help on using the changeset viewer.
