Index: trunk/psLib/src/imageops/psImageMap.c
===================================================================
--- trunk/psLib/src/imageops/psImageMap.c	(revision 21169)
+++ trunk/psLib/src/imageops/psImageMap.c	(revision 21172)
@@ -7,6 +7,6 @@
  *  @author Eugene Magnier, IfA
  *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2008-11-17 02:37:28 $
+ *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-01-27 00:00:21 $
  *
  *  Copyright 2007 Institute for Astronomy, University of Hawaii
@@ -353,5 +353,5 @@
 }
 
-psVector *psImageMapEvalVector(const psImageMap *map, const psVector *x, const psVector *y)
+psVector *psImageMapEvalVector(const psImageMap *map, const psVector *mask, psMaskType maskValue, const psVector *x, const psVector *y)
 {
     PS_ASSERT_IMAGE_MAP_NON_NULL(map, NULL);
@@ -365,5 +365,9 @@
 
     for (int i = 0; i < x->n; i++) {
-        result->data.F32[i] = psImageUnbinPixel(x->data.F32[i], y->data.F32[i], map->map, map->binning);
+      if (mask && (mask->data.U8[i] & maskValue)) {
+	result->data.F32[i] = 0.0;
+      } else {	
+	result->data.F32[i] = psImageUnbinPixel(x->data.F32[i], y->data.F32[i], map->map, map->binning);
+      }
     }
 
Index: trunk/psLib/src/imageops/psImageMap.h
===================================================================
--- trunk/psLib/src/imageops/psImageMap.h	(revision 21169)
+++ trunk/psLib/src/imageops/psImageMap.h	(revision 21172)
@@ -7,6 +7,6 @@
  *  @author Eugene Magnier, IfA
  *
- *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2008-10-07 22:23:06 $
+ *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-01-27 00:00:21 $
  *
  *  Copyright 2007 Institute for Astronomy, University of Hawaii
@@ -77,5 +77,5 @@
 
 // apply the psImageMap to the given coordinate vectors (fine image pixels)
-psVector *psImageMapEvalVector (const psImageMap *map, const psVector *x, const psVector *y);
+psVector *psImageMapEvalVector (const psImageMap *map, const psVector *mask, psMaskType maskValue, const psVector *x, const psVector *y);
 
 /// @}
Index: trunk/psLib/src/imageops/psImageMapFit.c
===================================================================
--- trunk/psLib/src/imageops/psImageMapFit.c	(revision 21169)
+++ trunk/psLib/src/imageops/psImageMapFit.c	(revision 21172)
@@ -7,6 +7,6 @@
  *  @author Eugene Magnier, IfA
  *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2008-10-13 01:55:48 $
+ *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-01-27 00:00:21 $
  *
  *  Copyright 2007 Institute for Astronomy, University of Hawaii
@@ -397,5 +397,5 @@
         }
 
-        psVector *fit = psImageMapEvalVector(map, x, y);
+        psVector *fit = psImageMapEvalVector(map, mask, maskValue, x, y);
         if (fit == NULL) {
             psError(PS_ERR_UNKNOWN, false, "Failure in psImageMapEvalVector().\n");
