Changeset 17217
- Timestamp:
- Mar 28, 2008, 4:08:16 PM (18 years ago)
- Location:
- branches/pap_branch_080320/psModules/src/detrend
- Files:
-
- 2 edited
-
pmShutterCorrection.c (modified) (4 diffs)
-
pmShutterCorrection.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap_branch_080320/psModules/src/detrend/pmShutterCorrection.c
r17155 r17217 631 631 632 632 633 bool pmShutterCorrectionApply(pmReadout *readout, const pmReadout *shutter )633 bool pmShutterCorrectionApply(pmReadout *readout, const pmReadout *shutter, psMaskType blank) 634 634 { 635 635 PS_ASSERT_PTR_NON_NULL(readout, false); … … 675 675 } 676 676 psImage *image = readout->image; // Image to correct 677 psImage *mask = readout->mask; // Corresponding mask 677 678 678 679 if (exptime <= 0.0) { … … 681 682 for (int y = 0; y < image->numRows; y++) { 682 683 for (int x = 0; x < image->numCols; x++) { 684 if (mask && !isfinite(shutterImage->data.F32[y][x])) { 685 mask->data.PS_TYPE_MASK_DATA[y][x] |= blank; 686 image->data.F32[y][x] = NAN; 687 continue; 688 } 683 689 image->data.F32[y][x] *= 1.0 / (exptime + shutterImage->data.F32[y][x]); 684 690 } … … 692 698 for (int y = 0; y < image->numRows; y++) { 693 699 for (int x = 0; x < image->numCols; x++) { 700 if (mask && !isfinite(shutterImage->data.F32[y][x])) { 701 mask->data.PS_TYPE_MASK_DATA[y][x] |= blank; 702 image->data.F32[y][x] = NAN; 703 continue; 704 } 694 705 image->data.F32[y][x] *= exptime / (exptime + shutterImage->data.F32[y][x]); 695 706 } -
branches/pap_branch_080320/psModules/src/detrend/pmShutterCorrection.h
r17155 r17217 5 5 * @author Paul Price, IfA 6 6 * 7 * @version $Revision: 1.14.22. 1$ $Name: not supported by cvs2svn $8 * @date $Date: 2008-03-2 7 23:28:38$7 * @version $Revision: 1.14.22.2 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2008-03-29 02:08:16 $ 9 9 * Copyright 2006 Institute for Astronomy, University of Hawaii 10 10 */ … … 129 129 /// Given a shutter correction (with dT for each pixel), applies this correction to an input image. 130 130 bool pmShutterCorrectionApply( 131 pmReadout *readout, ///< Readout to which to apply shutter correction 132 const pmReadout *shutter ///< Shutter correction readout, with dT for each pixel 131 pmReadout *readout, ///< Readout to which to apply shutter correction 132 const pmReadout *shutter, ///< Shutter correction readout, with dT for each pixel 133 psMaskType blank ///< Value to give blank pixels 133 134 ); 134 135
Note:
See TracChangeset
for help on using the changeset viewer.
