Index: /trunk/psModules/src/concepts/pmConceptsStandard.c
===================================================================
--- /trunk/psModules/src/concepts/pmConceptsStandard.c	(revision 14292)
+++ /trunk/psModules/src/concepts/pmConceptsStandard.c	(revision 14293)
@@ -5,5 +5,5 @@
 #include <stdio.h>
 #include <string.h>
-#include <strings.h>		/* for strn?casecmp */
+#include <strings.h>            /* for strn?casecmp */
 #include <assert.h>
 #include <pslib.h>
@@ -49,10 +49,10 @@
 // FPA.FILTER
 psMetadataItem *p_pmConceptParse_FPA_FILTER(const psMetadataItem *concept,
-					    const psMetadataItem *pattern,
+                                            const psMetadataItem *pattern,
                                             pmConceptSource source,
-					    const psMetadata *cameraFormat,
-					    const pmFPA *fpa,
-					    const pmChip *chip,
-					    const pmCell *cell)
+                                            const psMetadata *cameraFormat,
+                                            const pmFPA *fpa,
+                                            const pmChip *chip,
+                                            const pmCell *cell)
 {
     assert(concept);
@@ -102,9 +102,9 @@
 
 psMetadataItem *p_pmConceptFormat_FPA_FILTER(const psMetadataItem *concept,
-					     pmConceptSource source,
-					     const psMetadata *cameraFormat,
-					     const pmFPA *fpa,
-					     const pmChip *chip,
-					     const pmCell *cell)
+                                             pmConceptSource source,
+                                             const psMetadata *cameraFormat,
+                                             const pmFPA *fpa,
+                                             const pmChip *chip,
+                                             const pmCell *cell)
 {
     assert(concept);
@@ -126,5 +126,8 @@
 
     const char *key = concept->data.str;        // The name to look up
-    
+    if (!key || strlen(key) == 0) {
+        return psMetadataItemAllocStr(concept->name, concept->comment, NULL);
+    }
+
     // the metadata is in the format (internal) STR (external)
     // find the first internal name that matches
@@ -141,10 +144,10 @@
 // FPA.RA and FPA.DEC
 psMetadataItem *p_pmConceptParse_FPA_Coords(const psMetadataItem *concept,
-					    const psMetadataItem *pattern,
+                                            const psMetadataItem *pattern,
                                             pmConceptSource source,
-					    const psMetadata *cameraFormat,
-					    const pmFPA *fpa,
-					    const pmChip *chip,
-					    const pmCell *cell)
+                                            const psMetadata *cameraFormat,
+                                            const pmFPA *fpa,
+                                            const pmChip *chip,
+                                            const pmCell *cell)
 {
     assert(concept);
@@ -167,5 +170,5 @@
             // XXX: Upgrade path is to allow dd:mm.mmm
             if (sscanf(concept->data.V, "%d:%d:%f", &big, &medium, &small) != 3 &&
-		sscanf(concept->data.V, "%d %d %f", &big, &medium, &small) != 3)
+                sscanf(concept->data.V, "%d %d %f", &big, &medium, &small) != 3)
             {
                 psError(PS_ERR_UNKNOWN, true, "Cannot interpret %s: %s\n", pattern->name, concept->data.str);
@@ -212,9 +215,9 @@
 // FPA.RA and FPA.DEC
 psMetadataItem *p_pmConceptFormat_FPA_Coords(const psMetadataItem *concept,
-					     pmConceptSource source,
-					     const psMetadata *cameraFormat,
-					     const pmFPA *fpa,
-					     const pmChip *chip,
-					     const pmCell *cell)
+                                             pmConceptSource source,
+                                             const psMetadata *cameraFormat,
+                                             const pmFPA *fpa,
+                                             const pmChip *chip,
+                                             const pmCell *cell)
 {
     assert(concept);
@@ -230,6 +233,6 @@
     bool mdok = true;                   // Status of MD lookup
     psMetadata *formats = psMetadataLookupMetadata(&mdok,
-						   cameraFormat,
-						   "FORMATS");
+                                                   cameraFormat,
+                                                   "FORMATS");
     if (mdok && formats) {
         psString format = psMetadataLookupStr(&mdok,formats, concept->name);
@@ -274,10 +277,10 @@
 
 psMetadataItem *p_pmConceptParse_CELL_TRIMSEC(const psMetadataItem *concept,
-					      const psMetadataItem *pattern,
-					      pmConceptSource source,
-					      const psMetadata *cameraFormat,
-					      const pmFPA *fpa,
-					      const pmChip *chip,
-					      const pmCell *cell)
+                                              const psMetadataItem *pattern,
+                                              pmConceptSource source,
+                                              const psMetadata *cameraFormat,
+                                              const pmFPA *fpa,
+                                              const pmChip *chip,
+                                              const pmCell *cell)
 {
     assert(concept);
@@ -294,5 +297,5 @@
         return NULL;
     } else {
-	// allow for x and y flips in regions
+        // allow for x and y flips in regions
         *trimsec = psRegionAndParityFromString(&xParity, &yParity, concept->data.V);
     }
@@ -311,10 +314,10 @@
 
 psMetadataItem *p_pmConceptParse_CELL_BIASSEC(const psMetadataItem *concept,
-					      const psMetadataItem *pattern,
-					      pmConceptSource source,
-					      const psMetadata *cameraFormat,
-					      const pmFPA *fpa,
-					      const pmChip *chip,
-					      const pmCell *cell)
+                                              const psMetadataItem *pattern,
+                                              pmConceptSource source,
+                                              const psMetadata *cameraFormat,
+                                              const pmFPA *fpa,
+                                              const pmChip *chip,
+                                              const pmCell *cell)
 {
     assert(concept);
@@ -326,44 +329,44 @@
     switch (concept->type) {
       case PS_DATA_STRING: {
-	  // a single BIASSEC is of the form [AAAA]
-	  // we may have multiple BIASSEC entries separated by space, commas, or semicolons
-	  int xParity = 0;
-	  int yParity = 0;
-	  char *p = strchr (concept->data.V, '[');
-	  while (p != NULL) {
-	      char *q = strchr (p, ']');
-	      if (q == NULL) break;
-	      char *regionString = psAlloc (q - p + 2);
-	      strncpy (regionString, p, q - p + 1);
-	      regionString[q - p + 1] = 0;
-	  
-	      psRegion *region = psAlloc(sizeof(psRegion)); // The region
-	      *region = psRegionAndParityFromString(&xParity, &yParity, regionString);
-	      psListAdd(biassecs, PS_LIST_TAIL, region);
-	      psFree(region);           // Drop reference
-	      psFree(regionString);     // Drop reference
-	  
-	      p = strchr (q, '[');
-	  }
-	  break;
+          // a single BIASSEC is of the form [AAAA]
+          // we may have multiple BIASSEC entries separated by space, commas, or semicolons
+          int xParity = 0;
+          int yParity = 0;
+          char *p = strchr (concept->data.V, '[');
+          while (p != NULL) {
+              char *q = strchr (p, ']');
+              if (q == NULL) break;
+              char *regionString = psAlloc (q - p + 2);
+              strncpy (regionString, p, q - p + 1);
+              regionString[q - p + 1] = 0;
+
+              psRegion *region = psAlloc(sizeof(psRegion)); // The region
+              *region = psRegionAndParityFromString(&xParity, &yParity, regionString);
+              psListAdd(biassecs, PS_LIST_TAIL, region);
+              psFree(region);           // Drop reference
+              psFree(regionString);     // Drop reference
+
+              p = strchr (q, '[');
+          }
+          break;
       }
       case PS_DATA_LIST: {
-	  psList *regions = concept->data.V; // The list of regions
-	  psListIterator *regionsIter = psListIteratorAlloc(regions, PS_LIST_HEAD, false); // Iterator
-	  psMetadataItem *regionItem = NULL; // Item from list iteration
-	  while ((regionItem = psListGetAndIncrement(regionsIter))) {
-	      if (regionItem->type != PS_DATA_STRING) {
-		  psWarning("CELL.BIASSEC member is not of type STR --- ignored.\n");
-		  continue;
-	      }
-	      int xParity = 0;
-	      int yParity = 0;
-	      psRegion *region = psAlloc(sizeof(psRegion)); // The region
-	      *region = psRegionAndParityFromString(&xParity, &yParity, regionItem->data.V);
-	      psListAdd(biassecs, PS_LIST_TAIL, region);
-	      psFree(region);           // Drop reference
-	  }
-	  psFree(regionsIter);
-	  break;
+          psList *regions = concept->data.V; // The list of regions
+          psListIterator *regionsIter = psListIteratorAlloc(regions, PS_LIST_HEAD, false); // Iterator
+          psMetadataItem *regionItem = NULL; // Item from list iteration
+          while ((regionItem = psListGetAndIncrement(regionsIter))) {
+              if (regionItem->type != PS_DATA_STRING) {
+                  psWarning("CELL.BIASSEC member is not of type STR --- ignored.\n");
+                  continue;
+              }
+              int xParity = 0;
+              int yParity = 0;
+              psRegion *region = psAlloc(sizeof(psRegion)); // The region
+              *region = psRegionAndParityFromString(&xParity, &yParity, regionItem->data.V);
+              psListAdd(biassecs, PS_LIST_TAIL, region);
+              psFree(region);           // Drop reference
+          }
+          psFree(regionsIter);
+          break;
       }
       default:
@@ -386,10 +389,10 @@
 // CELL.XBIN and CELL.YBIN
 psMetadataItem *p_pmConceptParse_CELL_Binning(const psMetadataItem *concept,
-					      const psMetadataItem *pattern,
-					      pmConceptSource source,
-					      const psMetadata *cameraFormat,
-					      const pmFPA *fpa,
-					      const pmChip *chip,
-					      const pmCell *cell)
+                                              const psMetadataItem *pattern,
+                                              pmConceptSource source,
+                                              const psMetadata *cameraFormat,
+                                              const pmFPA *fpa,
+                                              const pmChip *chip,
+                                              const pmCell *cell)
 {
     assert(concept);
@@ -399,12 +402,12 @@
     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_UNKNOWN, true, "Unable to parse string to get %s: %s\n", pattern->name, binString);
-	  }
-	  break;
+          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_UNKNOWN, true, "Unable to parse string to get %s: %s\n", pattern->name, binString);
+          }
+          break;
       }
         TYPE_CASE(binning, concept, U8);
@@ -424,10 +427,10 @@
 
 psMetadataItem *p_pmConceptParse_TIMESYS(const psMetadataItem *concept,
-					 const psMetadataItem *pattern,
-					 pmConceptSource source,
-					 const psMetadata *cameraFormat,
-					 const pmFPA *fpa,
-					 const pmChip *chip,
-					 const pmCell *cell)
+                                         const psMetadataItem *pattern,
+                                         pmConceptSource source,
+                                         const psMetadata *cameraFormat,
+                                         const pmFPA *fpa,
+                                         const pmChip *chip,
+                                         const pmCell *cell)
 {
     assert(concept);
@@ -455,5 +458,5 @@
 psMetadataItem *p_pmConceptParse_TIME(const psMetadataItem *concept,
                                       const psMetadataItem *pattern,
-				      pmConceptSource source,
+                                      pmConceptSource source,
                                       const psMetadata *cameraFormat,
                                       const pmFPA *fpa,
@@ -480,5 +483,5 @@
     if (!mdok || (timeSys == 0xffffffff)) {
         psWarning("Unable to find %s in concepts when parsing %s --- assuming UTC.\n",
-		  timesysName, pattern->name);
+                  timesysName, pattern->name);
         timeSys = PS_TIME_UTC;
     }
@@ -560,129 +563,129 @@
     switch (concept->type) {
       case PS_DATA_LIST: {
-	  if (!separateTime) {
-	      psWarning ("DATE and TIME stored separately, but not specified in format\n");
-	  }
-	  // The date and time are stored separately
-	  // Assume the date is first and the time second
-	  psList *dateTime = concept->data.V; // The list containing items for date and time
-	  if (psListLength(dateTime) != 2) {
-	      psError(PS_ERR_BAD_PARAMETER_SIZE, false,
-		      "Unable to parse %s: date and time are not both available.", pattern->name);
-	      return NULL;
-	  }
-	  psMetadataItem *dateItem = psListGet(dateTime, PS_LIST_HEAD); // Item containing the date
-	  if (!dateItem) {
-	      psError(PS_ERR_UNKNOWN, true, "Date is not found.\n");
-	      return NULL;
-	  }
-	  if (dateItem->type != PS_DATA_STRING) {
-	      psError(PS_ERR_UNKNOWN, true, "Date is not of type STR.\n");
-	      return NULL;
-	  }
-	  psString dateString = dateItem->data.V; // The string with the date
-	  int day = 0, month = 0, year = 0;
-	  if (sscanf(dateString, "%d-%d-%d", &year, &month, &day) != 3 &&
-	      sscanf(dateString, "%d/%d/%d", &year, &month, &day) != 3) {
-	      psError(PS_ERR_UNKNOWN, true, "Unable to read date: %s\n", dateString);
-	      return NULL;
-	  }
-	  if (backwardsTime) {
-	      // Need to switch days and years
-	      int temp = day;
-	      day = year;
-	      year = temp;
-	  }
-	  if (usaTime) {
-	      // Need to switch everything around.... Yanks!
-	      int temp = day;
-	      day = month;
-	      month = year;
-	      year = temp;
-	  }
-	  if (year < 100) {
-	      if (pre2000Time) {
-		  year += 1900;
-	      } else {
-		  year += 2000;
-	      }
-	  }
-	  sprintf(dateString,"%04d-%02d-%02d", year, month, day);
-
-	  psMetadataItem *timeItem = psListGet(dateTime, PS_LIST_HEAD + 1); // Item containing the time
-	  if (!timeItem) {
-	      psError(PS_ERR_UNKNOWN, true, "Time is not found.\n");
-	      return NULL;
-	  }
-	  psString timeString = NULL; // The string with the time
-	  if (timeItem->type == PS_DATA_STRING) {
-	      timeString = timeItem->data.V;
-	  } else {
-	      // Assume that time is specified in Second of Day (!)
-	      double seconds = NAN;
-	      switch (timeItem->type) {
-		  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);
+          if (!separateTime) {
+              psWarning ("DATE and TIME stored separately, but not specified in format\n");
+          }
+          // The date and time are stored separately
+          // Assume the date is first and the time second
+          psList *dateTime = concept->data.V; // The list containing items for date and time
+          if (psListLength(dateTime) != 2) {
+              psError(PS_ERR_BAD_PARAMETER_SIZE, false,
+                      "Unable to parse %s: date and time are not both available.", pattern->name);
+              return NULL;
+          }
+          psMetadataItem *dateItem = psListGet(dateTime, PS_LIST_HEAD); // Item containing the date
+          if (!dateItem) {
+              psError(PS_ERR_UNKNOWN, true, "Date is not found.\n");
+              return NULL;
+          }
+          if (dateItem->type != PS_DATA_STRING) {
+              psError(PS_ERR_UNKNOWN, true, "Date is not of type STR.\n");
+              return NULL;
+          }
+          psString dateString = dateItem->data.V; // The string with the date
+          int day = 0, month = 0, year = 0;
+          if (sscanf(dateString, "%d-%d-%d", &year, &month, &day) != 3 &&
+              sscanf(dateString, "%d/%d/%d", &year, &month, &day) != 3) {
+              psError(PS_ERR_UNKNOWN, true, "Unable to read date: %s\n", dateString);
+              return NULL;
+          }
+          if (backwardsTime) {
+              // Need to switch days and years
+              int temp = day;
+              day = year;
+              year = temp;
+          }
+          if (usaTime) {
+              // Need to switch everything around.... Yanks!
+              int temp = day;
+              day = month;
+              month = year;
+              year = temp;
+          }
+          if (year < 100) {
+              if (pre2000Time) {
+                  year += 1900;
+              } else {
+                  year += 2000;
+              }
+          }
+          sprintf(dateString,"%04d-%02d-%02d", year, month, day);
+
+          psMetadataItem *timeItem = psListGet(dateTime, PS_LIST_HEAD + 1); // Item containing the time
+          if (!timeItem) {
+              psError(PS_ERR_UNKNOWN, true, "Time is not found.\n");
+              return NULL;
+          }
+          psString timeString = NULL; // The string with the time
+          if (timeItem->type == PS_DATA_STRING) {
+              timeString = timeItem->data.V;
+          } else {
+              // Assume that time is specified in Second of Day (!)
+              double seconds = NAN;
+              switch (timeItem->type) {
+                  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_UNKNOWN, true, "Time is not of an expected type: %x\n", timeItem->type);
-		  return NULL;
-	      }
-	      // Now print to timeString as "hh:mm:ss.ss"
-	      int hours = seconds / 3600;
-	      seconds -= (double)hours * 3600.0;
-	      int minutes = seconds / 60;
-	      seconds -= (double)minutes * 60.0;
-	      psStringAppend(&timeString, "%02d:%02d:%02f", hours, minutes, seconds);
-	  }
-	  psString dateTimeString = NULL;
-	  psStringAppend(&dateTimeString, "%sT%s", dateString, timeString);
-	  time = psTimeFromISO(dateTimeString, timeSys);
-	  psFree(dateTimeString);
-	  break;
+                  psError(PS_ERR_UNKNOWN, true, "Time is not of an expected type: %x\n", timeItem->type);
+                  return NULL;
+              }
+              // Now print to timeString as "hh:mm:ss.ss"
+              int hours = seconds / 3600;
+              seconds -= (double)hours * 3600.0;
+              int minutes = seconds / 60;
+              seconds -= (double)minutes * 60.0;
+              psStringAppend(&timeString, "%02d:%02d:%02f", hours, minutes, seconds);
+          }
+          psString dateTimeString = NULL;
+          psStringAppend(&dateTimeString, "%sT%s", dateString, timeString);
+          time = psTimeFromISO(dateTimeString, timeSys);
+          psFree(dateTimeString);
+          break;
       }
       case PS_DATA_STRING: {
-	  psString timeString = concept->data.V;   // String with the time
-	  if (jdTime) {
-	      double timeValue = strtod (timeString, NULL);
-	      time = psTimeFromJD(timeValue);
-	  } else if (mjdTime) {
-	      double timeValue = strtod (timeString, NULL);
-	      time = psTimeFromMJD(timeValue);
-	  } else {
-	      // It's ISO
-	      time = psTimeFromISO(timeString, timeSys);
-	  } // Interpreting the time string
-	  break;
+          psString timeString = concept->data.V;   // String with the time
+          if (jdTime) {
+              double timeValue = strtod (timeString, NULL);
+              time = psTimeFromJD(timeValue);
+          } else if (mjdTime) {
+              double timeValue = strtod (timeString, NULL);
+              time = psTimeFromMJD(timeValue);
+          } else {
+              // It's ISO
+              time = psTimeFromISO(timeString, timeSys);
+          } // Interpreting the time string
+          break;
       }
       case PS_TYPE_F32: {
-	  double timeValue = (double)concept->data.F32;
-	  if (jdTime) {
-	      time = psTimeFromJD(timeValue);
-	  } else if (mjdTime) {
-	      time = psTimeFromMJD(timeValue);
-	  } else {
-	      psError(PS_ERR_UNKNOWN, true, "Not sure how to parse %s (%f) --- trying JD\n",
-		      pattern->name, timeValue);
-	      time = psTimeFromJD(timeValue);
-	  }
-	  break;
+          double timeValue = (double)concept->data.F32;
+          if (jdTime) {
+              time = psTimeFromJD(timeValue);
+          } else if (mjdTime) {
+              time = psTimeFromMJD(timeValue);
+          } else {
+              psError(PS_ERR_UNKNOWN, true, "Not sure how to parse %s (%f) --- trying JD\n",
+                      pattern->name, timeValue);
+              time = psTimeFromJD(timeValue);
+          }
+          break;
       }
       case PS_TYPE_F64: {
-	  double timeValue = (double)concept->data.F64;
-	  if (jdTime) {
-	      time = psTimeFromJD(timeValue);
-	  } else if (mjdTime) {
-	      time = psTimeFromMJD(timeValue);
-	  } else {
-	      psError(PS_ERR_UNKNOWN, true, "Not sure how to parse %s (%f) --- trying JD\n",
-		      pattern->name, timeValue);
-	      time = psTimeFromJD(timeValue);
-	  }
-	  break;
+          double timeValue = (double)concept->data.F64;
+          if (jdTime) {
+              time = psTimeFromJD(timeValue);
+          } else if (mjdTime) {
+              time = psTimeFromMJD(timeValue);
+          } else {
+              psError(PS_ERR_UNKNOWN, true, "Not sure how to parse %s (%f) --- trying JD\n",
+                      pattern->name, timeValue);
+              time = psTimeFromJD(timeValue);
+          }
+          break;
       }
       default:
@@ -713,10 +716,10 @@
 
 psMetadataItem *p_pmConceptParse_Positions(const psMetadataItem *concept,
-					   const psMetadataItem *pattern,
-					   pmConceptSource source,
-					   const psMetadata *cameraFormat,
-					   const pmFPA *fpa,
-					   const pmChip *chip,
-					   const pmCell *cell)
+                                           const psMetadataItem *pattern,
+                                           pmConceptSource source,
+                                           const psMetadata *cameraFormat,
+                                           const pmFPA *fpa,
+                                           const pmChip *chip,
+                                           const pmCell *cell)
 {
     assert(concept);
@@ -735,23 +738,23 @@
 
       case PS_DATA_STRING: {
-	  // Interpret as a region specifier [x0:x1,y0:y1]
-	  int xParity = 0;
-	  int yParity = 0;
-	  psRegion region = psRegionAndParityFromString(&xParity, &yParity, concept->data.V);
-	  if (strstr(pattern->name, ".X0")) {
-	      offset = region.x0;
-	  } else if (strstr(pattern->name, ".Y0")) {
-	      offset = region.y0;
-	  } else if (strstr(pattern->name, ".X1")) {
-	      offset = region.x1;
-	  } else if (strstr(pattern->name, ".Y1")) {
-	      offset = region.y1;
-	  } else {
-	      psError(PS_ERR_UNKNOWN, true,
-		      "Unable to interpret %s because unable to determine if concept is X or Y.\n",
-		      pattern->name);
-	      return NULL;
-	  }
-	  break;
+          // Interpret as a region specifier [x0:x1,y0:y1]
+          int xParity = 0;
+          int yParity = 0;
+          psRegion region = psRegionAndParityFromString(&xParity, &yParity, concept->data.V);
+          if (strstr(pattern->name, ".X0")) {
+              offset = region.x0;
+          } else if (strstr(pattern->name, ".Y0")) {
+              offset = region.y0;
+          } else if (strstr(pattern->name, ".X1")) {
+              offset = region.x1;
+          } else if (strstr(pattern->name, ".Y1")) {
+              offset = region.y1;
+          } else {
+              psError(PS_ERR_UNKNOWN, true,
+                      "Unable to interpret %s because unable to determine if concept is X or Y.\n",
+                      pattern->name);
+              return NULL;
+          }
+          break;
       }
 #endif
@@ -772,9 +775,9 @@
 
 psMetadataItem *p_pmConceptFormat_CELL_TRIMSEC(const psMetadataItem *concept,
-					       pmConceptSource source,
-					       const psMetadata *cameraFormat,
-					       const pmFPA *fpa,
-					       const pmChip *chip,
-					       const pmCell *cell)
+                                               pmConceptSource source,
+                                               const psMetadata *cameraFormat,
+                                               const pmFPA *fpa,
+                                               const pmChip *chip,
+                                               const pmCell *cell)
 {
     assert(concept);
@@ -801,5 +804,5 @@
     psFree(trimsec);
     psMetadataItem *formatted = psMetadataItemAllocStr(concept->name, concept->comment,
-						       trimsecString);
+                                                       trimsecString);
     psFree(trimsecString);
     return formatted;
@@ -807,9 +810,9 @@
 
 psMetadataItem *p_pmConceptFormat_CELL_BIASSEC(const psMetadataItem *concept,
-					       pmConceptSource source,
-					       const psMetadata *cameraFormat,
-					       const pmFPA *fpa,
-					       const pmChip *chip,
-					       const pmCell *cell)
+                                               pmConceptSource source,
+                                               const psMetadata *cameraFormat,
+                                               const pmFPA *fpa,
+                                               const pmChip *chip,
+                                               const pmCell *cell)
 {
     // Return a metadata item containing a list of metadata items of region strings
@@ -853,8 +856,8 @@
 psMetadataItem *p_pmConceptFormat_CELL_XBIN(const psMetadataItem *concept,
                                             pmConceptSource source,
-					    const psMetadata *cameraFormat,
-					    const pmFPA *fpa,
-					    const pmChip *chip,
-					    const pmCell *cell)
+                                            const psMetadata *cameraFormat,
+                                            const pmFPA *fpa,
+                                            const pmChip *chip,
+                                            const pmCell *cell)
 {
     assert(concept);
@@ -865,5 +868,5 @@
     psString yKeyword = psMetadataLookupStr(&yBinOK, translation, "CELL.YBIN");
     if (xBinOK && yBinOK && strlen(xKeyword) > 0 && strlen(yKeyword) > 0 &&
-	strcasecmp(xKeyword, yKeyword) == 0) {
+        strcasecmp(xKeyword, yKeyword) == 0) {
         psMetadataItem *yBinItem = psMetadataLookup(cell->concepts, "CELL.YBIN"); // Binning factor in y
         psString binString = NULL;
@@ -881,8 +884,8 @@
 psMetadataItem *p_pmConceptFormat_CELL_YBIN(const psMetadataItem *concept,
                                             pmConceptSource source,
-					    const psMetadata *cameraFormat,
-					    const pmFPA *fpa,
-					    const pmChip *chip,
-					    const pmCell *cell)
+                                            const psMetadata *cameraFormat,
+                                            const pmFPA *fpa,
+                                            const pmChip *chip,
+                                            const pmCell *cell)
 {
     assert(concept);
@@ -893,5 +896,5 @@
     psString yKeyword = psMetadataLookupStr(&yBinOK, translation, "CELL.YBIN");
     if (xBinOK && yBinOK && strlen(xKeyword) > 0 && strlen(yKeyword) > 0 &&
-	strcasecmp(xKeyword, yKeyword) == 0) {
+        strcasecmp(xKeyword, yKeyword) == 0) {
         // Censor this --- it's already done (though no harm if it's done twice
         return NULL;
@@ -904,9 +907,9 @@
 
 psMetadataItem *p_pmConceptFormat_TIMESYS(const psMetadataItem *concept,
-					  pmConceptSource source,
-					  const psMetadata *cameraFormat,
-					  const pmFPA *fpa,
-					  const pmChip *chip,
-					  const pmCell *cell)
+                                          pmConceptSource source,
+                                          const psMetadata *cameraFormat,
+                                          const pmFPA *fpa,
+                                          const pmChip *chip,
+                                          const pmCell *cell)
 {
     psString sys = NULL;            // String to store
@@ -934,5 +937,5 @@
 
 psMetadataItem *p_pmConceptFormat_TIME(const psMetadataItem *concept,
-				       pmConceptSource source,
+                                       pmConceptSource source,
                                        const psMetadata *cameraFormat,
                                        const pmFPA *fpa,
@@ -993,5 +996,5 @@
                 } else {
                     psWarning("Unrecognised FORMATS option for %s: %s --- "
-			      "ignored.\n", concept->name, format);
+                              "ignored.\n", concept->name, format);
                 }
             }
@@ -1034,7 +1037,7 @@
 
         psMetadataItem *dateItem = psMetadataItemAllocStr(concept->name, "The date of observation",
-							  dateString);
+                                                          dateString);
         psMetadataItem *timeItem = psMetadataItemAllocStr(concept->name, "The time of observation",
-							  timeString);
+                                                          timeString);
 
         psListRemove(dateTime, PS_LIST_HEAD);
@@ -1045,5 +1048,5 @@
 
         psMetadataItem *item = psMetadataItemAllocPtr(concept->name, PS_DATA_LIST, concept->comment,
-						      dateTime);
+                                                      dateTime);
         psFree (dateItem);
         psFree (timeItem);
@@ -1070,8 +1073,8 @@
 psMetadataItem *p_pmConceptFormat_Positions(const psMetadataItem *concept,
                                             pmConceptSource source,
-					    const psMetadata *cameraFormat,
-					    const pmFPA *fpa,
-					    const pmChip *chip,
-					    const pmCell *cell)
+                                            const psMetadata *cameraFormat,
+                                            const pmFPA *fpa,
+                                            const pmChip *chip,
+                                            const pmCell *cell)
 {
     assert(concept);
@@ -1103,5 +1106,5 @@
         psString yKeyword = psMetadataLookupStr(&yFound, translation, companion);
         if (xFound && yFound && strlen(xKeyword) > 0 && strlen(yKeyword) > 0 &&
-	    strcasecmp(xKeyword, yKeyword) == 0) {
+            strcasecmp(xKeyword, yKeyword) == 0) {
             psMetadataItem *yItem = psMetadataLookup(cell->concepts, companion); // Corresponding y value
 
@@ -1128,5 +1131,5 @@
         psFree(companion);
         if (xFound && yFound && strlen(xKeyword) > 0 && strlen(yKeyword) > 0 &&
-	    strcasecmp(xKeyword, yKeyword) == 0) {
+            strcasecmp(xKeyword, yKeyword) == 0) {
             return NULL;                // We did it with the X; don't do anything.
         }
