Index: branches/rel10_ifa/psModules/src/pslib/psAdditionals.c
===================================================================
--- branches/rel10_ifa/psModules/src/pslib/psAdditionals.c	(revision 6848)
+++ branches/rel10_ifa/psModules/src/pslib/psAdditionals.c	(revision 6859)
@@ -143,4 +143,7 @@
 {
     psList *values = psListAlloc(NULL); // The list of values to return
+    if (string == NULL)
+        return values;  // NULL string is not an error, just an empty list
+
     unsigned int length = strlen(string); // The length of the string
     unsigned int numSplitters = strlen(splitters); // Number of characters that might split
@@ -176,4 +179,13 @@
 }
 
+psArray *psStringSplitArray (const char *string, const char *splitters)
+{
+
+    psList *list = psStringSplit (string, splitters);
+    psArray *array = psListToArray (list);
+    psFree (list);
+    return array;
+}
+
 #ifndef whitespace
 #define whitespace(c) (((c) == ' ') || ((c) == '\t'))
Index: branches/rel10_ifa/psModules/src/pslib/psAdditionals.h
===================================================================
--- branches/rel10_ifa/psModules/src/pslib/psAdditionals.h	(revision 6848)
+++ branches/rel10_ifa/psModules/src/pslib/psAdditionals.h	(revision 6859)
@@ -30,4 +30,9 @@
                      );
 
+// Split string on given characters
+psArray *psStringSplitArray(const char *string, // String to split
+                            const char *splitters // Characters on which to split
+                           );
+
 // strip whitespace from head and tail of string
 int psStringStrip (char *string);
Index: branches/rel10_ifa/psModules/src/pslib/psImageUnbin.c
===================================================================
--- branches/rel10_ifa/psModules/src/pslib/psImageUnbin.c	(revision 6848)
+++ branches/rel10_ifa/psModules/src/pslib/psImageUnbin.c	(revision 6859)
@@ -179,5 +179,5 @@
 }
 
-double psImageClippedStats (psImage *image, psImage *mask, psU8 maskValue, double fmin, double fmax)
+psStats *psImageClippedStats (psImage *image, psImage *mask, psU8 maskValue, double fmin, double fmax)
 {
     double value;
@@ -185,6 +185,7 @@
     int ny = image->numRows;
 
+    psStats *stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_QUARTILE);
     if (nx*ny <= 0)
-        return 0.0;
+        return stats;
 
     int Nsubset = PS_MIN (MAX_SAMPLE_PIXELS, nx*ny);
@@ -203,5 +204,5 @@
         int iy = pixel / nx;
 
-        if (mask->data.U8[iy][ix] & maskValue)
+        if (mask && mask->data.U8[iy][ix] & maskValue)
             continue;
 
@@ -226,8 +227,11 @@
     value = value / npts;
 
+    stats->robustMedian = value;
+    stats->robustUQ = values->data.F32[imax];
+    stats->robustLQ = values->data.F32[imin];
+
+    psFree (values);
+    return stats;
     // XXX correct for selection bias??
-
-    psFree (values);
-    return value;
 }
 
Index: branches/rel10_ifa/psModules/src/pslib/psImageUnbin.h
===================================================================
--- branches/rel10_ifa/psModules/src/pslib/psImageUnbin.h	(revision 6848)
+++ branches/rel10_ifa/psModules/src/pslib/psImageUnbin.h	(revision 6859)
@@ -11,5 +11,5 @@
 
 // my temporary image stats function; seems to be much faster than psLib???
-double psImageClippedStats (psImage *image, psImage *mask, psU8 maskValue, double fmin, double fmax);
+psStats *psImageClippedStats (psImage *image, psImage *mask, psU8 maskValue, double fmin, double fmax);
 
 // my temporary sort which is based on N.R.; seems to be faster than psLib sort???
