Index: trunk/psModules/src/config/pmConfigCamera.c
===================================================================
--- trunk/psModules/src/config/pmConfigCamera.c	(revision 12597)
+++ trunk/psModules/src/config/pmConfigCamera.c	(revision 12639)
@@ -49,4 +49,10 @@
     removeConcept(source, "CELL.Y0");
 
+    // For the sake of the defaults, include the .DEPEND
+    removeConcept(source, "CELL.XPARITY.DEPEND");
+    removeConcept(source, "CELL.YPARITY.DEPEND");
+    removeConcept(source, "CELL.X0.DEPEND");
+    removeConcept(source, "CELL.Y0.DEPEND");
+
     return;
 }
@@ -65,4 +71,10 @@
     removeConcept(source, "CHIP.X0");
     removeConcept(source, "CHIP.Y0");
+
+    // For the sake of the defaults, include the .DEPEND
+    removeConcept(source, "CHIP.XPARITY.DEPEND");
+    removeConcept(source, "CHIP.YPARITY.DEPEND");
+    removeConcept(source, "CHIP.X0.DEPEND");
+    removeConcept(source, "CHIP.Y0.DEPEND");
 
     return;
@@ -85,5 +97,5 @@
     psMetadata *camera = psMetadataLookupMetadata(NULL, oldCameras, name); // The camera configuration
     if (!camera) {
-	// XXX is this an error?
+        // XXX is this an error?
         psError(PS_ERR_UNEXPECTED_NULL, false, "Can't find camera to be mosaicked in camera list.");
         return false;
@@ -109,5 +121,5 @@
     }
     switch (mosaicLevel) {
-	// For CHIP mosaic, replace the contents of each chip with a single cell
+        // For CHIP mosaic, replace the contents of each chip with a single cell
       case PM_FPA_LEVEL_CHIP: {
           psMetadataIterator *fpaIter = psMetadataIteratorAlloc(fpa, PS_LIST_HEAD, NULL); // Iterator
@@ -117,6 +129,6 @@
                   psError(PS_ERR_UNKNOWN, true, "Element %s within FPA in camera configuration is not of type STR.",
                             fpaItem->name);
-		  psFree(new);
-		  return false;
+                  psFree(new);
+                  return false;
               }
 
@@ -129,5 +141,5 @@
           break;
       }
-	// For FPA mosaic, replace the contents of the FPA with a single chip containing a single cell
+        // For FPA mosaic, replace the contents of the FPA with a single chip containing a single cell
       case PM_FPA_LEVEL_FPA: {
           while (psListLength(fpa->list) > 0) {
@@ -156,13 +168,13 @@
 
         // Add a new RULE which uniquely describes the mosaicked format.  this is needed so
-	// that when a mosaic is written to a FITS file, it can be recognised again when read.
+        // that when a mosaic is written to a FITS file, it can be recognised again when read.
         psMetadata *rule = psMetadataLookupMetadata(NULL, format, "RULE"); // Way to identify format from PHU
         if (!rule) {
-	    // a camera format without a rule is not allowed.
-	    psError(PS_ERR_UNKNOWN, false, "Camera format %s has no RULE", formatsItem->name);
-	    return false;
-	}
-
-	// the new rule is supplemented by the mosaicLevel
+            // a camera format without a rule is not allowed.
+            psError(PS_ERR_UNKNOWN, false, "Camera format %s has no RULE", formatsItem->name);
+            return false;
+        }
+
+        // the new rule is supplemented by the mosaicLevel
         switch (mosaicLevel) {
         case PM_FPA_LEVEL_CHIP:
@@ -177,15 +189,15 @@
 
         // Fix the FILE information: need to fix the levels for the PHU and EXTENSIONS.
-	// both of these elements are required in the format; we raise an error if they are not found
+        // both of these elements are required in the format; we raise an error if they are not found
         // If EXTENSIONS is NONE, then we need to change the CONTENT specifier to point to the chip name.
         psMetadata *file = psMetadataLookupMetadata(NULL, format, "FILE"); // File information
         if (!file) {
             psError(PS_ERR_UNKNOWN, false, "Camera format %s has no FILE", formatsItem->name);
-	    return false;
+            return false;
         }
         psMetadataItem *phuItem = psMetadataLookup(file, "PHU"); // PHU level
         if (!phuItem || phuItem->type != PS_DATA_STRING) {
             psError(PS_ERR_UNKNOWN, false, "Camera format %s is missing PHU in the FILE information", formatsItem->name);
-	    return false;
+            return false;
         }
         psMetadataItem *extensionsItem = psMetadataLookup(file, "EXTENSIONS"); // Extensions level
@@ -195,58 +207,58 @@
         }
 
-	// mosaicLevel == CHIP:
-	// Case    PHU     EXTENSIONS     Modifications
-	// ====    ===     ==========     ===========
-	// 1.      FPA     CHIP           NONE
-	// 2.      FPA     CELL           EXT->CHIP
-	// 3.      FPA     NONE           NONE
-	// 4.      CHIP    CELL           EXT->NONE
-	// 5.      CHIP    NONE           NONE
-	// 6.      CELL    NONE           PHU->CHIP
-	// possible outcomes:
-	//         FPA     CHIP
-	//         FPA     NONE
-	//         CHIP    NONE
-
-	// mosaicLevel == FPA:
-	// Case    PHU     EXTENSIONS     Modifications
-	// ====    ===     ==========     ===========
-	// 1.      FPA     CHIP           EXT->NONE
-	// 2.      FPA     CELL           EXT->NONE
-	// 3.      FPA     NONE           NONE
-	// 4.      CHIP    CELL           PHU->FPA, EXT->NONE
-	// 5.      CHIP    NONE           PHU->FPA
-	// 6.      CELL    NONE           PHU->FPA
-	// possible outcomes:
-	//         FPA     NONE
-
-	// modify the values of phuItem and extensionsItem
+        // mosaicLevel == CHIP:
+        // Case    PHU     EXTENSIONS     Modifications
+        // ====    ===     ==========     ===========
+        // 1.      FPA     CHIP           NONE
+        // 2.      FPA     CELL           EXT->CHIP
+        // 3.      FPA     NONE           NONE
+        // 4.      CHIP    CELL           EXT->NONE
+        // 5.      CHIP    NONE           NONE
+        // 6.      CELL    NONE           PHU->CHIP
+        // possible outcomes:
+        //         FPA     CHIP
+        //         FPA     NONE
+        //         CHIP    NONE
+
+        // mosaicLevel == FPA:
+        // Case    PHU     EXTENSIONS     Modifications
+        // ====    ===     ==========     ===========
+        // 1.      FPA     CHIP           EXT->NONE
+        // 2.      FPA     CELL           EXT->NONE
+        // 3.      FPA     NONE           NONE
+        // 4.      CHIP    CELL           PHU->FPA, EXT->NONE
+        // 5.      CHIP    NONE           PHU->FPA
+        // 6.      CELL    NONE           PHU->FPA
+        // possible outcomes:
+        //         FPA     NONE
+
+        // modify the values of phuItem and extensionsItem
         switch (mosaicLevel) {
           case PM_FPA_LEVEL_CHIP:
             if (!strcasecmp(phuItem->data.str, "FPA") && !strcasecmp(extensionsItem->data.str, "CHIP")) {
-		break;
-            } 
+                break;
+            }
             if (!strcasecmp(phuItem->data.str, "FPA") && !strcasecmp(extensionsItem->data.str, "CELL")) {
                 psFree(extensionsItem->data.str);
                 extensionsItem->data.str = psStringCopy("CHIP");
-		break;
-            } 
+                break;
+            }
             if (!strcasecmp(phuItem->data.str, "FPA") && !strcasecmp(extensionsItem->data.str, "NONE")) {
-		break;
-            } 
+                break;
+            }
             if (!strcasecmp(phuItem->data.str, "CHIP") && !strcasecmp(extensionsItem->data.str, "CELL")) {
                 psFree(extensionsItem->data.str);
                 extensionsItem->data.str = psStringCopy("NONE");
-		break;
-            } 
+                break;
+            }
             if (!strcasecmp(phuItem->data.str, "CHIP") && !strcasecmp(extensionsItem->data.str, "NONE")) {
-		break;
-            } 
+                break;
+            }
             if (!strcasecmp(phuItem->data.str, "CELL") && !strcasecmp(extensionsItem->data.str, "NONE")) {
-		psFree(phuItem->data.str);
+                psFree(phuItem->data.str);
                 phuItem->data.str = psStringCopy("CHIP");
-		break;
-            } 
-	    psAbort ("should not reach here");
+                break;
+            }
+            psAbort ("should not reach here");
 
           case PM_FPA_LEVEL_FPA:
@@ -254,58 +266,57 @@
                 psFree(extensionsItem->data.str);
                 extensionsItem->data.str = psStringCopy("NONE");
-		break;
-            } 
+                break;
+            }
             if (!strcasecmp(phuItem->data.str, "FPA") && !strcasecmp(extensionsItem->data.str, "CELL")) {
                 psFree(extensionsItem->data.str);
                 extensionsItem->data.str = psStringCopy("NONE");
-		break;
-            } 
+                break;
+            }
             if (!strcasecmp(phuItem->data.str, "FPA") && !strcasecmp(extensionsItem->data.str, "NONE")) {
-		break;
-            } 
+                break;
+            }
             if (!strcasecmp(phuItem->data.str, "CHIP") && !strcasecmp(extensionsItem->data.str, "CELL")) {
-		psFree(phuItem->data.str);
+                psFree(phuItem->data.str);
                 phuItem->data.str = psStringCopy("FPA");
-		break;
                 psFree(extensionsItem->data.str);
                 extensionsItem->data.str = psStringCopy("NONE");
-		break;
-            } 
+                break;
+            }
             if (!strcasecmp(phuItem->data.str, "CHIP") && !strcasecmp(extensionsItem->data.str, "NONE")) {
-		psFree(phuItem->data.str);
+                psFree(phuItem->data.str);
                 phuItem->data.str = psStringCopy("FPA");
-		break;
-            } 
+                break;
+            }
             if (!strcasecmp(phuItem->data.str, "CELL") && !strcasecmp(extensionsItem->data.str, "NONE")) {
-		psFree(phuItem->data.str);
+                psFree(phuItem->data.str);
                 phuItem->data.str = psStringCopy("FPA");
-		break;
-            } 
-	    psAbort ("should not reach here");
-
-	  default:
+                break;
+            }
+            psAbort ("should not reach here");
+
+          default:
             psAbort("Should never get here.\n");
         }
 
 #if 0
-	// XXXX when do I need to adjust the value of CONTENT, CELL.NAME, CHIP.NAME?
-
-	// Don't need a "CONTENT" to identify the content!
-	if (psMetadataLookup(file, "CONTENT")) {
-	    psMetadataRemoveKey(file, "CONTENT");
-	}
-	psMetadataAddStr(file, PS_LIST_TAIL, "CONTENT", PS_META_REPLACE, "Key to CONTENTS menu",
-			 "{CHIP.NAME}");
-	// Don't need CELL.NAME for chip-mosaicked camera
-	if (psMetadataLookup(file, "CELL.NAME")) {
-	    psMetadataRemoveKey(file, "CELL.NAME");
-	}
-	// Don't need CHIP.NAME or CELL.NAME for fpa-mosaicked camera
-	if (psMetadataLookup(file, "CHIP.NAME")) {
-	    psMetadataRemoveKey(file, "CHIP.NAME");
-	}
-	if (psMetadataLookup(file, "CELL.NAME")) {
-	    psMetadataRemoveKey(file, "CELL.NAME");
-	}
+        // XXXX when do I need to adjust the value of CONTENT, CELL.NAME, CHIP.NAME?
+
+        // Don't need a "CONTENT" to identify the content!
+        if (psMetadataLookup(file, "CONTENT")) {
+            psMetadataRemoveKey(file, "CONTENT");
+        }
+        psMetadataAddStr(file, PS_LIST_TAIL, "CONTENT", PS_META_REPLACE, "Key to CONTENTS menu",
+                         "{CHIP.NAME}");
+        // Don't need CELL.NAME for chip-mosaicked camera
+        if (psMetadataLookup(file, "CELL.NAME")) {
+            psMetadataRemoveKey(file, "CELL.NAME");
+        }
+        // Don't need CHIP.NAME or CELL.NAME for fpa-mosaicked camera
+        if (psMetadataLookup(file, "CHIP.NAME")) {
+            psMetadataRemoveKey(file, "CHIP.NAME");
+        }
+        if (psMetadataLookup(file, "CELL.NAME")) {
+            psMetadataRemoveKey(file, "CELL.NAME");
+        }
 #endif
 
@@ -318,77 +329,77 @@
           case PM_FPA_LEVEL_CHIP:
             if (!strcasecmp(phuItem->data.str, "FPA") && !strcasecmp(extensionsItem->data.str, "CHIP")) {
-		// ensure the value of CONTENT in the FILE section has the right value
-		psMetadataAddStr(file, PS_LIST_TAIL, "CONTENT", PS_META_REPLACE, "Key to CONTENTS menu", "{CHIP.NAME}");
-
-		// List the chipName:chipType for each chip.
-		psMetadata *contents = psMetadataAlloc(); // List of contents, with chipName:chipType
-
-		psMetadataIterator *fpaIter = psMetadataIteratorAlloc(fpa, PS_LIST_HEAD, NULL); // Iteratr
-		psMetadataItem *fpaItem;    // Item from iteration
-		while ((fpaItem = psMetadataGetAndIncrement(fpaIter))) {
-		    assert (fpaItem->type == PS_DATA_STRING); 
-		    psString content = NULL; // Content to add
-		    psStringAppend(&content, "%s:_mosaicChip ", fpaItem->name);
-		    psMetadataAddStr(contents, PS_LIST_TAIL, fpaItem->name, 0, NULL, content);
-		    psFree(content);
-		}
-		psFree(fpaIter);
-		psMetadataAddMetadata(format, PS_LIST_TAIL, TABLE_OF_CONTENTS, PS_META_REPLACE,
-				      "List of contents", contents);
-		psFree(contents);
-
-		psMetadata *chips = psMetadataAlloc(); // List of chip types, with cellName:cellType
-		psMetadataAddStr(chips, PS_LIST_TAIL, "_mosaicChip", 0, NULL,
-				 "MosaickedCell:_mosaic");
-		psMetadataAddMetadata(format, PS_LIST_TAIL, CHIP_TYPES, PS_META_REPLACE,
-				      "List of chip types", chips);
-		psFree(chips);
-		break;
-	    } 
-	    if (!strcasecmp(phuItem->data.str, "FPA") && !strcasecmp(extensionsItem->data.str, "NONE")) {
-		// List the contents on a single line
-		psString contentsLine = NULL; // Contents of the PHU
-		psMetadataIterator *fpaIter = psMetadataIteratorAlloc(fpa, PS_LIST_HEAD, NULL); // Iteratr
-		psMetadataItem *fpaItem;    // Item from iteration
-		while ((fpaItem = psMetadataGetAndIncrement(fpaIter))) {
-		    assert (fpaItem->type == PS_DATA_STRING);
-		    psStringAppend(&contentsLine, "%s:MosaickedCell:_mosaic ", fpaItem->name);
-		}
-		psFree(fpaIter);
-		psMetadataAddStr(format, PS_LIST_TAIL, TABLE_OF_CONTENTS, PS_META_REPLACE,
-				 NULL, contentsLine);
-		psFree(contentsLine);
-		break;
-	    }
-	    if (!strcasecmp(phuItem->data.str, "CHIP") && !strcasecmp(extensionsItem->data.str, "NONE")) {
-		// XXX recode this to match the structure above (FPA/CHIP)?
-		// select and remove the old contents
-		psMetadata *contents = psMetadataLookupMetadata(NULL, format, TABLE_OF_CONTENTS); // File contents
-		if (!contents) {
-		    psError(PS_ERR_UNKNOWN, false, "Couldn't find %s in the camera format %s.\n", 
-			    TABLE_OF_CONTENTS, formatsItem->name);
-		    return false;
-		}
-		while (psListLength(contents->list) > 0) {
-		    psMetadataRemoveIndex(contents, PS_LIST_TAIL);
-		}
-
-		// update with the new contents
-		psMetadataIterator *fpaIter = psMetadataIteratorAlloc(fpa, PS_LIST_HEAD, NULL); // Iterator
-		psMetadataItem *fpaItem;    // Item from iteration
-		while ((fpaItem = psMetadataGetAndIncrement(fpaIter))) {
-		    assert (fpaItem->type == PS_DATA_STRING);
-		    psMetadataAddStr(contents, PS_LIST_TAIL, fpaItem->name, 0, NULL, "_mosaicChip");
-		}
-		psFree(fpaIter);
-
-		psMetadata *chips = psMetadataAlloc(); // List of chip types, with cellName:cellType
-		psMetadataAddStr(chips, PS_LIST_TAIL, "_mosaicChip", 0, NULL,
-				 "MosaickedCell:_mosaic");
-		psMetadataAddMetadata(format, PS_LIST_TAIL, CHIP_TYPES, PS_META_REPLACE,
-				      "List of chip types", chips);
-		psFree(chips);
-		break;
-	    }
+                // ensure the value of CONTENT in the FILE section has the right value
+                psMetadataAddStr(file, PS_LIST_TAIL, "CONTENT", PS_META_REPLACE, "Key to CONTENTS menu", "{CHIP.NAME}");
+
+                // List the chipName:chipType for each chip.
+                psMetadata *contents = psMetadataAlloc(); // List of contents, with chipName:chipType
+
+                psMetadataIterator *fpaIter = psMetadataIteratorAlloc(fpa, PS_LIST_HEAD, NULL); // Iteratr
+                psMetadataItem *fpaItem;    // Item from iteration
+                while ((fpaItem = psMetadataGetAndIncrement(fpaIter))) {
+                    assert (fpaItem->type == PS_DATA_STRING);
+                    psString content = NULL; // Content to add
+                    psStringAppend(&content, "%s:_mosaicChip ", fpaItem->name);
+                    psMetadataAddStr(contents, PS_LIST_TAIL, fpaItem->name, 0, NULL, content);
+                    psFree(content);
+                }
+                psFree(fpaIter);
+                psMetadataAddMetadata(format, PS_LIST_TAIL, TABLE_OF_CONTENTS, PS_META_REPLACE,
+                                      "List of contents", contents);
+                psFree(contents);
+
+                psMetadata *chips = psMetadataAlloc(); // List of chip types, with cellName:cellType
+                psMetadataAddStr(chips, PS_LIST_TAIL, "_mosaicChip", 0, NULL,
+                                 "MosaickedCell:_mosaic");
+                psMetadataAddMetadata(format, PS_LIST_TAIL, CHIP_TYPES, PS_META_REPLACE,
+                                      "List of chip types", chips);
+                psFree(chips);
+                break;
+            }
+            if (!strcasecmp(phuItem->data.str, "FPA") && !strcasecmp(extensionsItem->data.str, "NONE")) {
+                // List the contents on a single line
+                psString contentsLine = NULL; // Contents of the PHU
+                psMetadataIterator *fpaIter = psMetadataIteratorAlloc(fpa, PS_LIST_HEAD, NULL); // Iteratr
+                psMetadataItem *fpaItem;    // Item from iteration
+                while ((fpaItem = psMetadataGetAndIncrement(fpaIter))) {
+                    assert (fpaItem->type == PS_DATA_STRING);
+                    psStringAppend(&contentsLine, "%s:MosaickedCell:_mosaic ", fpaItem->name);
+                }
+                psFree(fpaIter);
+                psMetadataAddStr(format, PS_LIST_TAIL, TABLE_OF_CONTENTS, PS_META_REPLACE,
+                                 NULL, contentsLine);
+                psFree(contentsLine);
+                break;
+            }
+            if (!strcasecmp(phuItem->data.str, "CHIP") && !strcasecmp(extensionsItem->data.str, "NONE")) {
+                // XXX recode this to match the structure above (FPA/CHIP)?
+                // select and remove the old contents
+                psMetadata *contents = psMetadataLookupMetadata(NULL, format, TABLE_OF_CONTENTS); // File contents
+                if (!contents) {
+                    psError(PS_ERR_UNKNOWN, false, "Couldn't find %s in the camera format %s.\n",
+                            TABLE_OF_CONTENTS, formatsItem->name);
+                    return false;
+                }
+                while (psListLength(contents->list) > 0) {
+                    psMetadataRemoveIndex(contents, PS_LIST_TAIL);
+                }
+
+                // update with the new contents
+                psMetadataIterator *fpaIter = psMetadataIteratorAlloc(fpa, PS_LIST_HEAD, NULL); // Iterator
+                psMetadataItem *fpaItem;    // Item from iteration
+                while ((fpaItem = psMetadataGetAndIncrement(fpaIter))) {
+                    assert (fpaItem->type == PS_DATA_STRING);
+                    psMetadataAddStr(contents, PS_LIST_TAIL, fpaItem->name, 0, NULL, "_mosaicChip");
+                }
+                psFree(fpaIter);
+
+                psMetadata *chips = psMetadataAlloc(); // List of chip types, with cellName:cellType
+                psMetadataAddStr(chips, PS_LIST_TAIL, "_mosaicChip", 0, NULL,
+                                 "MosaickedCell:_mosaic");
+                psMetadataAddMetadata(format, PS_LIST_TAIL, CHIP_TYPES, PS_META_REPLACE,
+                                      "List of chip types", chips);
+                psFree(chips);
+                break;
+            }
         default:
             psAbort("Should never get here.\n");
@@ -399,5 +410,5 @@
         if (!cells) {
             psError(PS_ERR_UNKNOWN, false, "Couldn't find CELLS of type METADATA in the camera format %s.\n", formatsItem->name);
-	    return false;
+            return false;
         }
         psMetadata *cell = psMetadataAlloc(); // Cell information
