Index: /branches/pap_branch_080320/psModules/src/detrend/pmShutterCorrection.c
===================================================================
--- /branches/pap_branch_080320/psModules/src/detrend/pmShutterCorrection.c	(revision 17216)
+++ /branches/pap_branch_080320/psModules/src/detrend/pmShutterCorrection.c	(revision 17217)
@@ -631,5 +631,5 @@
 
 
-bool pmShutterCorrectionApply(pmReadout *readout, const pmReadout *shutter)
+bool pmShutterCorrectionApply(pmReadout *readout, const pmReadout *shutter, psMaskType blank)
 {
     PS_ASSERT_PTR_NON_NULL(readout, false);
@@ -675,4 +675,5 @@
     }
     psImage *image = readout->image;    // Image to correct
+    psImage *mask = readout->mask;      // Corresponding mask
 
     if (exptime <= 0.0) {
@@ -681,4 +682,9 @@
         for (int y = 0; y < image->numRows; y++) {
             for (int x = 0; x < image->numCols; x++) {
+                if (mask && !isfinite(shutterImage->data.F32[y][x])) {
+                    mask->data.PS_TYPE_MASK_DATA[y][x] |= blank;
+                    image->data.F32[y][x] = NAN;
+                    continue;
+                }
                 image->data.F32[y][x] *= 1.0 / (exptime + shutterImage->data.F32[y][x]);
             }
@@ -692,4 +698,9 @@
         for (int y = 0; y < image->numRows; y++) {
             for (int x = 0; x < image->numCols; x++) {
+                if (mask && !isfinite(shutterImage->data.F32[y][x])) {
+                    mask->data.PS_TYPE_MASK_DATA[y][x] |= blank;
+                    image->data.F32[y][x] = NAN;
+                    continue;
+                }
                 image->data.F32[y][x] *= exptime / (exptime + shutterImage->data.F32[y][x]);
             }
Index: /branches/pap_branch_080320/psModules/src/detrend/pmShutterCorrection.h
===================================================================
--- /branches/pap_branch_080320/psModules/src/detrend/pmShutterCorrection.h	(revision 17216)
+++ /branches/pap_branch_080320/psModules/src/detrend/pmShutterCorrection.h	(revision 17217)
@@ -5,6 +5,6 @@
  * @author Paul Price, IfA
  *
- * @version $Revision: 1.14.22.1 $ $Name: not supported by cvs2svn $
- * @date $Date: 2008-03-27 23:28:38 $
+ * @version $Revision: 1.14.22.2 $ $Name: not supported by cvs2svn $
+ * @date $Date: 2008-03-29 02:08:16 $
  * Copyright 2006 Institute for Astronomy, University of Hawaii
  */
@@ -129,6 +129,7 @@
 /// Given a shutter correction (with dT for each pixel), applies this correction to an input image.
 bool pmShutterCorrectionApply(
-    pmReadout *readout, ///< Readout to which to apply shutter correction
-    const pmReadout *shutter ///< Shutter correction readout, with dT for each pixel
+    pmReadout *readout,                 ///< Readout to which to apply shutter correction
+    const pmReadout *shutter,           ///< Shutter correction readout, with dT for each pixel
+    psMaskType blank                    ///< Value to give blank pixels
     );
 
