Index: trunk/psphot/src/psphotCullPeaks.c
===================================================================
--- trunk/psphot/src/psphotCullPeaks.c	(revision 34201)
+++ trunk/psphot/src/psphotCullPeaks.c	(revision 34202)
@@ -63,4 +63,15 @@
 # if (PM_PEAKS_CULL_WITH_SMOOTHED_IMAGE)
     psLogMsg ("psphot", PS_LOG_INFO, "Culling peaks from footprints using the smoothed image");
+    bool setNaNsToZero = psMetadataLookupF32 (&status, recipe, "FOOTPRINT_SET_NANS_TO_ZERO");
+    if (setNaNsToZero) {
+        // Set NaN pixels to zero so that they do not considered in the footprint analysis
+        // XXX: Currently the caller does nothing further with the significance readout so
+        // modifiying the image does no harm
+        // XXX: Note: signifR->weight is not used by pmFootprintCullPeaks so we don't
+        // need to touch it
+        psImageClipNaN(signifR->image, 0);
+    }
+        
+
 # else
     psLogMsg ("psphot", PS_LOG_INFO, "Culling peaks from footprints using the raw (unsmoothed) image");
