Index: /branches/eam_branch_20070830/psLib/src/imageops/psImageUnbin.c
===================================================================
--- /branches/eam_branch_20070830/psLib/src/imageops/psImageUnbin.c	(revision 14905)
+++ /branches/eam_branch_20070830/psLib/src/imageops/psImageUnbin.c	(revision 14906)
@@ -7,6 +7,6 @@
  *  @author Eugene Magnier, IfA
  *
- *  @version $Revision: 1.7.8.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-09-17 01:14:28 $
+ *  @version $Revision: 1.7.8.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-09-20 19:16:15 $
  *
  *  Copyright 2007 Institute for Astronomy, University of Hawaii
@@ -284,4 +284,12 @@
     }
 
+    // limiting cases: Nx == 1 and/or Ny == 1
+
+    // if we have a single pixel, there is no spatial information
+    if ((in->numCols == 1) && (in->numRows == 1)) {
+	const double value = in->data.F32[0][0];
+	return value;
+    }
+
     // handle edge cases with extrapolation
 
@@ -289,4 +297,5 @@
     const int iy = y - 0.5; // index of reference pixel
 
+    // do numCols,Rows first so we are never < 0
     const int Xs = PS_MAX (PS_MIN (ix, in->numCols - 2), 0);
     const int Ys = PS_MAX (PS_MIN (iy, in->numRows - 2), 0);
@@ -301,4 +310,22 @@
     const double rx = 1.0 - dx;
     const double ry = 1.0 - dy;
+
+    // if Nx == 1, we have no x-dir spatial information
+    if (in->numCols == 1) {
+	double V0 = in->data.F32[Ys][Xs];
+	double V1 = in->data.F32[Ye][Xs];
+
+	const double value = V0*ry + V1*dy;
+	return value;
+    }	
+
+    // if Ny == 1, we have no y-dir spatial information
+    if (in->numRows == 1) {
+	double V0 = in->data.F32[Ys][Xs];
+	double V1 = in->data.F32[Ys][Xe];
+
+	const double value = V0*rx + V1*dx;
+	return value;
+    }	
 
     // Vxy 
