Changeset 12988 for trunk/psModules/src/detrend/pmShutterCorrection.c
- Timestamp:
- Apr 24, 2007, 11:17:19 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/detrend/pmShutterCorrection.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/detrend/pmShutterCorrection.c
r12696 r12988 12 12 #include "pmHDUUtils.h" 13 13 #include "psVectorBracket.h" 14 #include "pmConceptsAverage.h" 15 14 16 #include "pmShutterCorrection.h" 15 17 … … 347 349 #define MEASURE_SAMPLES 4 348 350 349 psImage *pmShutterCorrectionMeasure(const psArray *readouts, int size, psStatsOptions meanStat,350 psStatsOptions stdevStat, int nIter, float rej, psMaskType maskVal)351 bool pmShutterCorrectionMeasure(pmReadout *output, const psArray *readouts, int size, psStatsOptions meanStat, 352 psStatsOptions stdevStat, int nIter, float rej, psMaskType maskVal) 351 353 { 352 354 PS_ASSERT_ARRAY_NON_NULL(readouts, NULL); … … 591 593 592 594 if (psTraceGetLevel("psModules.detrend") > 5) { 593 psFits *fits = psFitsOpen("pattern.fits", "w");594 psFitsWriteImage(fits, NULL, pattern, 0, NULL);595 psFitsClose(fits);595 psFits *fits = psFitsOpen("pattern.fits", "w"); 596 psFitsWriteImage(fits, NULL, pattern, 0, NULL); 597 psFitsClose(fits); 596 598 } 597 599 psFree(pattern); 598 600 599 return shutter; 601 output->image = shutter; 602 603 // Update the "concepts" 604 psList *inputCells = psListAlloc(NULL); // List of cells 605 for (long i = 0; i < readouts->n; i++) { 606 pmReadout *readout = readouts->data[i]; // Readout of interest 607 psListAdd(inputCells, PS_LIST_TAIL, readout->parent); 608 } 609 bool success = pmConceptsAverageCells(output->parent, inputCells, NULL, NULL, true); 610 psFree(inputCells); 611 612 // Correct the exposure times --- they don't make sense any more. 613 psMetadataItem *item = psMetadataLookup(output->parent->concepts, "CELL.EXPOSURE"); 614 item->data.F32 = NAN; 615 item = psMetadataLookup(output->parent->concepts, "CELL.DARKTIME"); 616 item->data.F32 = NAN; 617 618 return success; 600 619 601 620 … … 611 630 psFree(samplesMean); 612 631 psFree(samplesStdev); 613 return NULL;632 return false; 614 633 } 615 634
Note:
See TracChangeset
for help on using the changeset viewer.
