Index: trunk/psModules/src/astrom/pmConcepts.c
===================================================================
--- trunk/psModules/src/astrom/pmConcepts.c	(revision 6894)
+++ trunk/psModules/src/astrom/pmConcepts.c	(revision 6895)
@@ -41,5 +41,5 @@
                        pmConceptParseFunc parse, // Function to call to parse the concept
                        pmConceptFormatFunc format, // Function to call to format the concept
-                       pmConceptLevel level // Level at which to store concept in the FPA hierarchy
+                       pmFPALevel level // Level at which to store concept in the FPA hierarchy
                       )
 {
@@ -52,15 +52,15 @@
     psMetadata **target = NULL;         // The metadata of known concepts to write to
     switch (level) {
-    case PM_CONCEPT_LEVEL_FPA:
+    case PM_FPA_LEVEL_FPA:
         target = &conceptsFPA;
         break;
-    case PM_CONCEPT_LEVEL_CHIP:
+    case PM_FPA_LEVEL_CHIP:
         target = &conceptsChip;
         break;
-    case PM_CONCEPT_LEVEL_CELL:
+    case PM_FPA_LEVEL_CELL:
         target = &conceptsCell;
         break;
     default:
-        psError(PS_ERR_IO, true, "Unknown concept level provided: %d\n", level);
+        psError(PS_ERR_IO, true, "Invalid concept level provided: %d\n", level);
         psFree(spec);
         return false;
@@ -285,5 +285,5 @@
         {
             psMetadataItem *fpaName = psMetadataItemAllocStr("FPA.NAME", "Name of FPA", "");
-            pmConceptRegister(fpaName, NULL, NULL, PM_CONCEPT_LEVEL_FPA);
+            pmConceptRegister(fpaName, NULL, NULL, PM_FPA_LEVEL_FPA);
             psFree(fpaName);
         }
@@ -293,5 +293,5 @@
         {
             psMetadataItem *fpaAirmass = psMetadataItemAllocF32("FPA.AIRMASS", "Airmass at boresight", 0.0);
-            pmConceptRegister(fpaAirmass, NULL, NULL, PM_CONCEPT_LEVEL_FPA);
+            pmConceptRegister(fpaAirmass, NULL, NULL, PM_FPA_LEVEL_FPA);
             psFree(fpaAirmass);
         }
@@ -300,5 +300,5 @@
         {
             psMetadataItem *fpaFilter = psMetadataItemAllocStr("FPA.FILTER", "Filter used", "");
-            pmConceptRegister(fpaFilter, NULL, NULL, PM_CONCEPT_LEVEL_FPA);
+            pmConceptRegister(fpaFilter, NULL, NULL, PM_FPA_LEVEL_FPA);
             psFree(fpaFilter);
         }
@@ -308,5 +308,5 @@
             psMetadataItem *fpaPosangle = psMetadataItemAllocF32("FPA.POSANGLE",
                                           "Position angle of instrument", 0.0);
-            pmConceptRegister(fpaPosangle, NULL, NULL, PM_CONCEPT_LEVEL_FPA);
+            pmConceptRegister(fpaPosangle, NULL, NULL, PM_FPA_LEVEL_FPA);
             psFree(fpaPosangle);
         }
@@ -316,5 +316,5 @@
             psMetadataItem *fpaRadecsys = psMetadataItemAllocStr("FPA.RADECSYS",
                                           "Celestial coordinate system", "");
-            pmConceptRegister(fpaRadecsys, NULL, NULL, PM_CONCEPT_LEVEL_FPA);
+            pmConceptRegister(fpaRadecsys, NULL, NULL, PM_FPA_LEVEL_FPA);
             psFree(fpaRadecsys);
         }
@@ -324,5 +324,5 @@
             psMetadataItem *fpaRa = psMetadataItemAllocF64("FPA.RA", "Right Ascension of boresight", NAN);
             pmConceptRegister(fpaRa, (pmConceptParseFunc)pmConceptParse_FPA_Coords,
-                              (pmConceptFormatFunc)pmConceptFormat_FPA_Coords, PM_CONCEPT_LEVEL_FPA);
+                              (pmConceptFormatFunc)pmConceptFormat_FPA_Coords, PM_FPA_LEVEL_FPA);
             psFree(fpaRa);
         }
@@ -332,5 +332,5 @@
             psMetadataItem *fpaDec = psMetadataItemAllocF64("FPA.DEC", "Declination of boresight", NAN);
             pmConceptRegister(fpaDec, (pmConceptParseFunc)pmConceptParse_FPA_Coords,
-                              (pmConceptFormatFunc)pmConceptFormat_FPA_Coords, PM_CONCEPT_LEVEL_FPA);
+                              (pmConceptFormatFunc)pmConceptFormat_FPA_Coords, PM_FPA_LEVEL_FPA);
             psFree(fpaDec);
         }
@@ -352,5 +352,5 @@
         {
             psMetadataItem *cellGain = psMetadataItemAllocF32("CELL.GAIN", "CCD gain (e/count)", NAN);
-            pmConceptRegister(cellGain, NULL, NULL, PM_CONCEPT_LEVEL_CELL);
+            pmConceptRegister(cellGain, NULL, NULL, PM_FPA_LEVEL_CELL);
             psFree(cellGain);
         }
@@ -360,5 +360,5 @@
             psMetadataItem *cellReadnoise = psMetadataItemAllocF32("CELL.READNOISE",
                                             "CCD read noise (e)", NAN);
-            pmConceptRegister(cellReadnoise, NULL, NULL, PM_CONCEPT_LEVEL_CELL);
+            pmConceptRegister(cellReadnoise, NULL, NULL, PM_FPA_LEVEL_CELL);
             psFree(cellReadnoise);
         }
@@ -368,5 +368,5 @@
             psMetadataItem *cellSaturation = psMetadataItemAllocF32("CELL.SATURATION",
                                              "Saturation level (counts)", NAN);
-            pmConceptRegister(cellSaturation, NULL, NULL, PM_CONCEPT_LEVEL_CELL);
+            pmConceptRegister(cellSaturation, NULL, NULL, PM_FPA_LEVEL_CELL);
             psFree(cellSaturation);
         }
@@ -375,5 +375,5 @@
         {
             psMetadataItem *cellBad = psMetadataItemAllocF32("CELL.BAD", "Bad level (counts)", NAN);
-            pmConceptRegister(cellBad, NULL, NULL, PM_CONCEPT_LEVEL_CELL);
+            pmConceptRegister(cellBad, NULL, NULL, PM_FPA_LEVEL_CELL);
             psFree(cellBad);
         }
@@ -383,5 +383,5 @@
             psMetadataItem *cellXparity = psMetadataItemAllocS32("CELL.XPARITY",
                                           "Orientation in x compared to the rest of the FPA", 0);
-            pmConceptRegister(cellXparity, NULL, NULL, PM_CONCEPT_LEVEL_CELL);
+            pmConceptRegister(cellXparity, NULL, NULL, PM_FPA_LEVEL_CELL);
             psFree(cellXparity);
         }
@@ -391,5 +391,5 @@
             psMetadataItem *cellYparity = psMetadataItemAllocS32("CELL.YPARITY",
                                           "Orientation in x compared to the rest of the FPA", 0);
-            pmConceptRegister(cellYparity, NULL, NULL, PM_CONCEPT_LEVEL_CELL);
+            pmConceptRegister(cellYparity, NULL, NULL, PM_FPA_LEVEL_CELL);
             psFree(cellYparity);
         }
@@ -399,5 +399,5 @@
             psMetadataItem *cellReaddir = psMetadataItemAllocS32("CELL.READDIR",
                                           "Read direction, rows=1, cols=2", 0);
-            pmConceptRegister(cellReaddir, NULL, NULL, PM_CONCEPT_LEVEL_CELL);
+            pmConceptRegister(cellReaddir, NULL, NULL, PM_FPA_LEVEL_CELL);
             psFree(cellReaddir);
         }
@@ -414,5 +414,5 @@
             psMetadataItem *cellExposure = psMetadataItemAllocF32("CELL.EXPOSURE",
                                            "Exposure time (sec)", NAN);
-            pmConceptRegister(cellExposure, NULL, NULL, PM_CONCEPT_LEVEL_CELL);
+            pmConceptRegister(cellExposure, NULL, NULL, PM_FPA_LEVEL_CELL);
             psFree(cellExposure);
         }
@@ -422,5 +422,5 @@
             psMetadataItem *cellDarktime = psMetadataItemAllocF32("CELL.DARKTIME",
                                            "Time since flush (sec)", NAN);
-            pmConceptRegister(cellDarktime, NULL, NULL, PM_CONCEPT_LEVEL_CELL);
+            pmConceptRegister(cellDarktime, NULL, NULL, PM_FPA_LEVEL_CELL);
             psFree(cellDarktime);
         }
@@ -434,5 +434,5 @@
             psFree(trimsec);
             pmConceptRegister(cellTrimsec, (pmConceptParseFunc)pmConceptParse_CELL_TRIMSEC,
-                              (pmConceptFormatFunc)pmConceptFormat_CELL_TRIMSEC, PM_CONCEPT_LEVEL_CELL);
+                              (pmConceptFormatFunc)pmConceptFormat_CELL_TRIMSEC, PM_FPA_LEVEL_CELL);
             psFree(cellTrimsec);
         }
@@ -445,5 +445,5 @@
             psFree(biassecs);
             pmConceptRegister(cellBiassec, (pmConceptParseFunc)pmConceptParse_CELL_BIASSEC,
-                              (pmConceptFormatFunc)pmConceptFormat_CELL_BIASSEC, PM_CONCEPT_LEVEL_CELL);
+                              (pmConceptFormatFunc)pmConceptFormat_CELL_BIASSEC, PM_FPA_LEVEL_CELL);
             psFree(cellBiassec);
         }
@@ -453,5 +453,5 @@
             psMetadataItem *cellXbin = psMetadataItemAllocS32("CELL.XBIN", "Binning in x", 0);
             pmConceptRegister(cellXbin, (pmConceptParseFunc)pmConceptParse_CELL_Binning,
-                              (pmConceptFormatFunc)pmConceptFormat_CELL_XBIN, PM_CONCEPT_LEVEL_CELL);
+                              (pmConceptFormatFunc)pmConceptFormat_CELL_XBIN, PM_FPA_LEVEL_CELL);
             psFree(cellXbin);
         }
@@ -461,5 +461,5 @@
             psMetadataItem *cellYbin = psMetadataItemAllocS32("CELL.YBIN", "Binning in y", 0);
             pmConceptRegister(cellYbin, (pmConceptParseFunc)pmConceptParse_CELL_Binning,
-                              (pmConceptFormatFunc)pmConceptFormat_CELL_YBIN, PM_CONCEPT_LEVEL_CELL);
+                              (pmConceptFormatFunc)pmConceptFormat_CELL_YBIN, PM_FPA_LEVEL_CELL);
             psFree(cellYbin);
         }
@@ -469,5 +469,5 @@
             psMetadataItem *cellTimesys = psMetadataItemAllocS32("CELL.TIMESYS", "Time system", -1);
             pmConceptRegister(cellTimesys, (pmConceptParseFunc)pmConceptParse_CELL_TIMESYS,
-                              (pmConceptFormatFunc)pmConceptFormat_CELL_TIMESYS, PM_CONCEPT_LEVEL_CELL);
+                              (pmConceptFormatFunc)pmConceptFormat_CELL_TIMESYS, PM_FPA_LEVEL_CELL);
             psFree(cellTimesys);
         }
@@ -483,5 +483,5 @@
             psFree(time);
             pmConceptRegister(cellTime, (pmConceptParseFunc)pmConceptParse_CELL_TIME,
-                              (pmConceptFormatFunc)pmConceptFormat_CELL_TIME, PM_CONCEPT_LEVEL_CELL);
+                              (pmConceptFormatFunc)pmConceptFormat_CELL_TIME, PM_FPA_LEVEL_CELL);
             psFree(cellTime);
         }
@@ -491,5 +491,5 @@
             psMetadataItem *cellX0 = psMetadataItemAllocS32("CELL.X0", "Position of (0,0) on the chip", 0);
             pmConceptRegister(cellX0, (pmConceptParseFunc)pmConceptParse_CELL_Positions,
-                              (pmConceptFormatFunc)pmConceptFormat_CELL_Positions, PM_CONCEPT_LEVEL_CELL);
+                              (pmConceptFormatFunc)pmConceptFormat_CELL_Positions, PM_FPA_LEVEL_CELL);
             psFree(cellX0);
         }
@@ -499,5 +499,5 @@
             psMetadataItem *cellY0 = psMetadataItemAllocS32("CELL.Y0", "Position of (0,0) on the chip", 0);
             pmConceptRegister(cellY0, (pmConceptParseFunc)pmConceptParse_CELL_Positions,
-                              (pmConceptFormatFunc)pmConceptFormat_CELL_Positions, PM_CONCEPT_LEVEL_CELL);
+                              (pmConceptFormatFunc)pmConceptFormat_CELL_Positions, PM_FPA_LEVEL_CELL);
             psFree(cellY0);
         }
Index: trunk/psModules/src/astrom/pmConcepts.h
===================================================================
--- trunk/psModules/src/astrom/pmConcepts.h	(revision 6894)
+++ trunk/psModules/src/astrom/pmConcepts.h	(revision 6895)
@@ -27,16 +27,9 @@
                                  );
 
-// Level at which to store a concept in the FPA hierarchy
-typedef enum {
-    PM_CONCEPT_LEVEL_FPA,               // Store in the FPA
-    PM_CONCEPT_LEVEL_CHIP,              // Store in the chip
-    PM_CONCEPT_LEVEL_CELL               // Store in the cell
-} pmConceptLevel;
-
 // Register a new concept
 bool pmConceptRegister(psMetadataItem *blank, // Blank value; contains the name
                        pmConceptParseFunc parse, // Function to call to parse the concept
                        pmConceptFormatFunc format, // Function to call to format the concept
-                       pmConceptLevel level // Level at which to store concept in the FPA hierarchy
+                       pmFPALevel level // Level at which to store concept in the FPA hierarchy
                       );
 
Index: trunk/psModules/src/astrom/pmConceptsStandard.c
===================================================================
--- trunk/psModules/src/astrom/pmConceptsStandard.c	(revision 6894)
+++ 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);
