Index: trunk/psModules/src/astrom/pmConceptsStandard.c
===================================================================
--- trunk/psModules/src/astrom/pmConceptsStandard.c	(revision 6872)
+++ trunk/psModules/src/astrom/pmConceptsStandard.c	(revision 6895)
@@ -14,4 +14,10 @@
                                (a)->y0 == (b)->y0 && \
                                (a)->y1 == (b)->y1) ? true : false)
+
+#define TYPE_CASE(assign, item, TYPE) \
+case PS_TYPE_##TYPE: \
+assign = item->data.TYPE; \
+break;
+
 
 
@@ -218,15 +224,21 @@
 
     int binning = 1;                    // Binning factor in x
-    if (concept->type == PS_DATA_STRING) {
-        psString binString = concept->data.V; // The string containing the binning
-        if ((strcmp(pattern->name, "CELL.XBIN") == 0 && sscanf(binString, "%d %*d", &binning) != 1 &&
-                sscanf(binString, "%d,%*d", &binning) != 1) ||
-                (strcmp(pattern->name, "CELL.YBIN") == 0 && sscanf(binString, "%*d %d", &binning) != 1 &&
-                 sscanf(binString, "%*d,%d", &binning) != 1)) {
-            psError(PS_ERR_IO, true, "Unable to parse string to get %s: %s\n", pattern->name, binString);
-        }
-    } else if (concept->type == PS_TYPE_S32) {
-        binning = concept->data.S32;
-    } else {
+    switch (concept->type) {
+    case PS_DATA_STRING: {
+            psString binString = concept->data.V; // The string containing the binning
+            if ((strcmp(pattern->name, "CELL.XBIN") == 0 && sscanf(binString, "%d %*d", &binning) != 1 &&
+                    sscanf(binString, "%d,%*d", &binning) != 1) ||
+                    (strcmp(pattern->name, "CELL.YBIN") == 0 && sscanf(binString, "%*d %d", &binning) != 1 &&
+                     sscanf(binString, "%*d,%d", &binning) != 1)) {
+                psError(PS_ERR_IO, true, "Unable to parse string to get %s: %s\n", pattern->name, binString);
+            }
+        }
+        TYPE_CASE(binning, concept, U8);
+        TYPE_CASE(binning, concept, U16);
+        TYPE_CASE(binning, concept, U32);
+        TYPE_CASE(binning, concept, S8);
+        TYPE_CASE(binning, concept, S16);
+        TYPE_CASE(binning, concept, S32);
+    default:
         psError(PS_ERR_IO, true, "Note sure how to parse %s of type %x --- assuming 1.\n", pattern->name,
                 concept->type);
@@ -324,13 +336,12 @@
                 double seconds = NAN;
                 switch (timeItem->type) {
-                case PS_TYPE_S32:
-                    seconds = timeItem->data.S32;
-                    break;
-                case PS_TYPE_F32:
-                    seconds = timeItem->data.F32;
-                    break;
-                case PS_TYPE_F64:
-                    seconds = timeItem->data.F64;
-                    break;
+                    TYPE_CASE(seconds, timeItem, U8);
+                    TYPE_CASE(seconds, timeItem, U16);
+                    TYPE_CASE(seconds, timeItem, U32);
+                    TYPE_CASE(seconds, timeItem, S8);
+                    TYPE_CASE(seconds, timeItem, S16);
+                    TYPE_CASE(seconds, timeItem, S32);
+                    TYPE_CASE(seconds, timeItem, F32);
+                    TYPE_CASE(seconds, timeItem, F64);
                 default:
                     psError(PS_ERR_IO, true, "Time is not of an expected type: %x\n", timeItem->type);
@@ -424,9 +435,17 @@
     assert(cameraFormat);
 
-    if (concept->type != PS_TYPE_S32) {
-        psError(PS_ERR_IO, true, "Concept %s is not of type S32, as expected.\n", pattern->name);
+    int offset = 0;                     // Offset of cell (0,0) corner from the chip (0,0) corner
+
+    switch (concept->type) {
+        TYPE_CASE(offset, concept, U8);
+        TYPE_CASE(offset, concept, U16);
+        TYPE_CASE(offset, concept, U32);
+        TYPE_CASE(offset, concept, S8);
+        TYPE_CASE(offset, concept, S16);
+        TYPE_CASE(offset, concept, S32);
+    default:
+        psError(PS_ERR_IO, true, "Concept %s is not of integer type, as expected.\n", pattern->name);
         return NULL;
     }
-    int offset = concept->data.S32;
     offset -= fortranCorr(cameraFormat, pattern->name);
     return psMetadataItemAllocS32(pattern->name, pattern->comment, offset);
