Index: trunk/psModules/src/config/pmConfigCamera.c
===================================================================
--- trunk/psModules/src/config/pmConfigCamera.c	(revision 11370)
+++ trunk/psModules/src/config/pmConfigCamera.c	(revision 11375)
@@ -8,52 +8,38 @@
 
 
-// Update the sources of the concepts, so that they all come from the headers.
-static void updateConceptsSources(psList *concepts, // List of concepts
-                                  psMetadata *translation, // Header concepts
-                                  psMetadata *database, // Database concepts
-                                  psMetadata *defaults, // Defaults concepts
-                                  psMetadata *formats, // Concepts formats
-                                  pmFPALevel level // Mosaic level
+// Remove a concept from the list of sources.  Need to check to see if it exists first, to avoid a warning.
+static void removeConcept(psMetadata *source, // Source from which to remove concept
+                          const char *concept // Concept name to remove
+                         )
+{
+    assert(source);
+    assert(concept && strlen(concept) > 0);
+
+    if (psMetadataLookup(source, concept)) {
+        psMetadataRemoveKey(source, concept);
+    }
+
+    return;
+}
+
+// Remove certain concepts from the list of sources.  These concepts are important in the mosaicking process,
+// and are added explicitly to the defaults (elsewhere) so that the user can't get them wrong.
+static void removeConceptsSources(psMetadata *source // Source for concepts
                                  )
 {
-    assert(concepts);
-    assert(translation);
-    assert(level == PM_FPA_LEVEL_CHIP || level == PM_FPA_LEVEL_FPA);
-    return;
-
-    psListIterator *iter = psListIteratorAlloc(concepts, PS_LIST_HEAD, false); // Iterator
-    psString concept;                   // Concept, from iteration
-    while ((concept = psListGetAndIncrement(iter))) {
-        // skip concepts added explicitly
-        if (!strcmp(concept, "CELL.BIASSEC"))
-            goto skip;
-        if (!strcmp(concept, "CELL.TRIMSEC"))
-            goto skip;
-        if (!strcmp(concept, "CELL.XPARITY"))
-            goto skip;
-        if (!strcmp(concept, "CELL.YPARITY"))
-            goto skip;
-        if (!strcmp(concept, "CELL.X0"))
-            goto skip;
-        if (!strcmp(concept, "CELL.Y0"))
-            goto skip;
-        if ((level == PM_FPA_LEVEL_FPA) && !strcmp(concept, "CHIP.XPARITY"))
-            goto skip;
-        if ((level == PM_FPA_LEVEL_FPA) && !strcmp(concept, "CHIP.YPARITY"))
-            goto skip;
-        if ((level == PM_FPA_LEVEL_FPA) && !strcmp(concept, "CHIP.X0"))
-            goto skip;
-        if ((level == PM_FPA_LEVEL_FPA) && !strcmp(concept, "CHIP.Y0"))
-            goto skip;
-        psMetadataAddStr(translation, PS_LIST_TAIL, concept, PS_META_REPLACE, NULL, concept);
-skip:
-        if (database && psMetadataLookup(database, concept)) {
-            psMetadataRemoveKey(database, concept);
-        }
-        if (defaults && psMetadataLookup(defaults, concept)) {
-            psMetadataRemoveKey(defaults, concept);
-        }
-    }
-    psFree(iter);
+    if (!source) {
+        return;
+    }
+
+    removeConcept(source, "CELL.BIASSEC");
+    removeConcept(source, "CELL.TRIMSEC");
+    removeConcept(source, "CELL.XPARITY");
+    removeConcept(source, "CELL.YPARITY");
+    removeConcept(source, "CELL.X0");
+    removeConcept(source, "CELL.Y0");
+    removeConcept(source, "CHIP.XPARITY");
+    removeConcept(source, "CHIP.YPARITY");
+    removeConcept(source, "CHIP.X0");
+    removeConcept(source, "CHIP.Y0");
 
     return;
@@ -281,5 +267,4 @@
         // Update the concepts, so that they are all stored in the FITS headers, under headers of the same
         // name as the concept
-        psMetadata *conceptsFormats = psMetadataLookupMetadata(&mdok, format, "FORMATS"); // Concepts FORMATS
         psMetadata *database = psMetadataLookupMetadata(&mdok, format, "DATABASE"); // DATABASE concepts
         psMetadata *defaults = psMetadataLookupMetadata(&mdok, format, "DEFAULTS"); // DEFAULTS concepts
@@ -295,21 +280,16 @@
             continue;
         }
-        psList *concepts = pmConceptsList(PM_FPA_LEVEL_CELL); // List of concepts
-        updateConceptsSources(concepts, translation, database, defaults, conceptsFormats, level);
-        psFree(concepts);
-        concepts = pmConceptsList(PM_FPA_LEVEL_CHIP);
-        updateConceptsSources(concepts, translation, database, defaults, conceptsFormats, level);
-        psFree(concepts);
-        concepts = pmConceptsList(PM_FPA_LEVEL_FPA);
-        updateConceptsSources(concepts, translation, database, defaults, conceptsFormats, level);
-        psFree(concepts);
+
+        removeConceptsSources(translation);
+        removeConceptsSources(database);
+        removeConceptsSources(defaults);
 
         // Add in the positioning concepts
-        psMetadataAddS32(defaults, PS_LIST_TAIL, "CHIP.XPARITY", PS_META_REPLACE, NULL, 1);
-        psMetadataAddS32(defaults, PS_LIST_TAIL, "CHIP.YPARITY", PS_META_REPLACE, NULL, 1);
-        psMetadataAddS32(defaults, PS_LIST_TAIL, "CELL.XPARITY", PS_META_REPLACE, NULL, 1);
-        psMetadataAddS32(defaults, PS_LIST_TAIL, "CELL.YPARITY", PS_META_REPLACE, NULL, 1);
-        psMetadataAddS32(defaults, PS_LIST_TAIL, "CELL.X0",      PS_META_REPLACE, NULL, 0);
-        psMetadataAddS32(defaults, PS_LIST_TAIL, "CELL.Y0",      PS_META_REPLACE, NULL, 0);
+        psMetadataAddS32(defaults, PS_LIST_TAIL, "CHIP.XPARITY", 0, NULL, 1);
+        psMetadataAddS32(defaults, PS_LIST_TAIL, "CHIP.YPARITY", 0, NULL, 1);
+        psMetadataAddS32(defaults, PS_LIST_TAIL, "CELL.XPARITY", 0, NULL, 1);
+        psMetadataAddS32(defaults, PS_LIST_TAIL, "CELL.YPARITY", 0, NULL, 1);
+        psMetadataAddS32(defaults, PS_LIST_TAIL, "CELL.X0",      0, NULL, 0);
+        psMetadataAddS32(defaults, PS_LIST_TAIL, "CELL.Y0",      0, NULL, 0);
         if (formats) {
             if (psMetadataLookup(formats, "CELL.X0")) {
@@ -322,6 +302,6 @@
 
         if (level == PM_FPA_LEVEL_FPA) {
-            psMetadataAddS32(defaults, PS_LIST_TAIL, "CHIP.X0", PS_META_REPLACE, NULL, 0);
-            psMetadataAddS32(defaults, PS_LIST_TAIL, "CHIP.Y0", PS_META_REPLACE, NULL, 0);
+            psMetadataAddS32(defaults, PS_LIST_TAIL, "CHIP.X0", 0, NULL, 0);
+            psMetadataAddS32(defaults, PS_LIST_TAIL, "CHIP.Y0", 0, NULL, 0);
             if (formats) {
                 if (psMetadataLookup(formats, "CHIP.X0")) {
