Index: trunk/archive/scripts/src/pmFPAFromHeader.c
===================================================================
--- trunk/archive/scripts/src/pmFPAFromHeader.c	(revision 4092)
+++ trunk/archive/scripts/src/pmFPAFromHeader.c	(revision 4309)
@@ -80,23 +80,11 @@
 	}
 
-	bool extIsChips;		// Are the extensions chips (true) or cells (false)?
 	if (strcmp(extType, "CHIP") == 0) {
-	    extIsChips = true;	// Extensions are chips
-	} else if (strcmp(extType, "CELL") == 0) {
-	    extIsChips = false;	// Extensions are cells
-	} else {
-	    psError(PS_ERR_IO, false, "EXTENSIONS in camera definition is neither CHIP or CELL.\n");
-	    psFree(fpa);
-	    return NULL;
-	}
-
-	// Iterate through the contents
-	psMetadataIterator *contentsIter = psMetadataIteratorAlloc(contents, PS_LIST_HEAD, NULL);
-	psMetadataItem *contentItem = NULL; // Item from the metadata
-	while (contentItem = psMetadataGetAndIncrement(contentsIter)) {
-	    const char *extName = contentItem->name; // The name of the extension
-		
-	    if (extIsChips) {
-		// Content contains a list of cells
+	    // Extensions are chips; Content contains a list of cells
+	    psMetadataIterator *contentsIter = psMetadataIteratorAlloc(contents, PS_LIST_HEAD, NULL);
+	    psMetadataItem *contentItem = NULL; // Item from the metadata
+	    while (contentItem = psMetadataGetAndIncrement(contentsIter)) {
+		const char *extName = contentItem->name; // The name of the extension
+
 		if (contentItem->type != PS_META_STR) {
 		    psLogMsg(__func__, PS_LOG_WARN, "Type of content item (%x) is not string: ignored\n",
@@ -120,6 +108,14 @@
 		    psMetadataAdd(fpa, PS_LIST_TAIL, extName, PS_META_META, "", chip);
 		}
-	    } else {
-		// Content contains a chip name and cell type
+	    }
+	    psFree(contentsIter);
+
+	} else if (strcmp(extType, "CELL") == 0) {
+	    // Extensions are cells; Content contains a chip name and cell type
+	    psMetadataIterator *contentsIter = psMetadataIteratorAlloc(contents, PS_LIST_HEAD, NULL);
+	    psMetadataItem *contentItem = NULL; // Item from the metadata
+	    while (contentItem = psMetadataGetAndIncrement(contentsIter)) {
+		const char *extName = contentItem->name; // The name of the extension
+
 		if (contentItem->type != PS_META_STR) {
 		    psLogMsg(__func__, PS_LOG_WARN, "Type of content item (%x) is not string: ignored\n",
@@ -148,8 +144,38 @@
 		    }
 		}
-
-	    } // Type of extension
-	} // Iterating through contents
-	psFree(contentsIter);
+	    }
+	    psFree(contentsIter);
+	} else if (strcmp(extType, "NONE") == 0) {
+	    // No extensions; Content contains metadata, each entry is a chip with its component cells
+	    psMetadataIterator *contentsIter = psMetadataIteratorAlloc(contents, PS_LIST_HEAD, NULL);
+	    psMetadataItem *contentItem = NULL; // Item from the metadata
+	    while (contentItem = psMetadataGetAndIncrement(contentsIter)) {
+		const char *chipName = contentItem->name; // The name of the chip
+
+		if (contentItem->type != PS_META_STR) {
+		    psLogMsg(__func__, PS_LOG_WARN, "Type of content item (%x) is not string: ignored\n",
+			     contentItem->type);
+		} else {
+		    const char *content = contentItem->data.V; // The content of the extension
+		    psMetadata *chip = psMetadataAlloc(); // The chip
+		    psList *cellNames = papSplit(content, ", "); // Split the list of cells
+		    psListIterator *cellNamesIter = psListIteratorAlloc(cellNames, PS_LIST_HEAD, false);
+		    char *cellName = NULL; // Name of the cell
+		    while (cellName = psListGetAndIncrement(cellNamesIter)) {
+			psMetadata *cell = getCellData(camera, cellName);
+			psMetadataAdd(cell, PS_LIST_HEAD, "EXTENSION", PS_META_STR, "", "PHU");
+			psMetadataAdd(chip, PS_LIST_TAIL, cellName, PS_META_META, "", cell);
+		    }
+		    psFree(cellNamesIter);
+		    // Add the chip onto the FPA
+		    psMetadataAdd(fpa, PS_LIST_TAIL, chipName, PS_META_META, "", chip);
+		}
+	    }
+	    psFree(contentsIter);
+	} else {
+	    psError(PS_ERR_IO, false, "EXTENSIONS in camera definition is not CHIP, CELL or NONE.\n");
+	    psFree(fpa);
+	    return NULL;
+	} // Type of extension
 
     } else if (strcmp(phuType, "CHIP") == 0) {
