Index: /branches/eam_branch_20080223/Ohana/src/libdvo/src/LoadPhotcodesText.c
===================================================================
--- /branches/eam_branch_20080223/Ohana/src/libdvo/src/LoadPhotcodesText.c	(revision 16780)
+++ /branches/eam_branch_20080223/Ohana/src/libdvo/src/LoadPhotcodesText.c	(revision 16781)
@@ -27,6 +27,7 @@
   char *c;
   char line[256], **c1_names, **c2_names, **eq_names;
-  char name[32], type[32], Zero[32], Airmass[32], Offset[32],
-    C1[32], C2[32], Slope[32], Color[32], Primary[32];
+  char name[32], type[32], Zero[32], Airmass[32], Offset[32];
+  char C1[32], C2[32], Slope[32], Color[32], Primary[32];
+  char astromErrSys[32], astromErrScale[32], astromErrMagScale[32], photomErrSys[32];
 
   table = GetPhotcodeTable ();
@@ -60,12 +61,27 @@
     for (c = line; isspace (*c); c++);
     if (*c == '#') continue;
-    Nfield = sscanf (c, "%d %s %s %s %s %s %s %s %s %s %s", 
-		     &code, name, type, Zero, Airmass, Offset, C1, C2, Slope, Color, Primary);
-
-    // XXX to add the AstromError (and PhotError) terms, we need to add them to the photcode structure, and
-    // define methods to read (at least) the old and the new photcode versions.
-
-    if (Nfield != 11) { continue; }
-    
+    Nfield = sscanf (c, "%d %s %s %s %s %s %s %s %s %s %s %s %s %s %s", 
+		     &code, name, type, Zero, Airmass, Offset, C1, C2, Slope, Color, Primary, astromErrSys, astromErrScale, astromErrMagScale, photomErrSys);
+
+    switch (Nfield) {
+      case 11: 
+	// minimum number of fields : original elixir layout
+	strcpy (astromErrSys,      "0.0");
+	strcpy (astromErrScale,    "0.0");
+	strcpy (astromErrMagScale, "0.0");
+	strcpy (photomErrSys,      "0.0");
+	break;
+      case 14: 
+	// allow only astrom elements
+	strcpy (photomErrSys,      "0.0");
+	break;
+      case 15: 
+	// all fields defined
+	break;
+      default:
+	// skip unknown layouts
+	continue;
+    }
+
     if (!code) {
 	fprintf (stderr, "photcode values may not be 0: fix %s\n", name);
@@ -95,4 +111,9 @@
       photcode[Ncode].type  = PHOT_ALT;
     }
+
+    photcode[Ncode].astromErrSys      = atof (astromErrSys);
+    photcode[Ncode].astromErrScale    = atof (astromErrScale);
+    photcode[Ncode].astromErrMagScale = atof (astromErrMagScale);
+    photcode[Ncode].photomErrSys      = atof (photomErrSys);
 
     switch (photcode[Ncode].type) {
