Index: trunk/Ohana/src/imregister/detrend/output.c
===================================================================
--- trunk/Ohana/src/imregister/detrend/output.c	(revision 14)
+++ trunk/Ohana/src/imregister/detrend/output.c	(revision 21)
@@ -55,6 +55,6 @@
   DetReg *newdata;
   FILE *f;
-  char *startstr, *stopstr, *regstr, *line, key[33];
-  char *filtstr, *typestr, *ccdstr, *datestr, *p;
+  char *startstr, *stopstr, *regstr, *line, key[33], ccdinfo[16];
+  char *filtstr, *typestr, *modestr, *ccdstr, *datestr, *p;
   int i;
   unsigned long tsecond;
@@ -84,5 +84,6 @@
   fits_define_table_column (&theader, "A10",  "IMAGETYP",   "detrend type",              "");
   fits_define_table_column (&theader, "A10",  "FILTER",     "filter name",               "");
-  fits_define_table_column (&theader, "A7",   "CCDID",      "ccd name",                  "");
+  fits_define_table_column (&theader, "A7",   "CCDINFO",    "ccd information",                  "");
+  fits_define_table_column (&theader, "A7",   "MODE",       "data format mode",                  "");
   fits_define_table_column (&theader, "I3",   "VERSION",    "image version number",      "");
   fits_define_table_column (&theader, "I3",   "ORDER",      "selection order",           "");
@@ -98,9 +99,10 @@
   fits_modify (&theader, "TNULL6",  "%s", 1, "NULL");  /* IMAGETYP   */
   fits_modify (&theader, "TNULL7",  "%s", 1, "NULL");  /* FILTER     */
-  fits_modify (&theader, "TNULL8",  "%s", 1, "NULL");  /* CCDID      */
-  fits_modify (&theader, "TNULL9",  "%s", 1, "-1");    /* VERSION    */
-  fits_modify (&theader, "TNULL10", "%s", 1, "-1");    /* ORDER      */
-  fits_modify (&theader, "TNULL11", "%s", 1, "NULL");  /* LABEL      */
-  fits_modify (&theader, "TNULL12", "%s", 1, "NULL");  /* PATH       */
+  fits_modify (&theader, "TNULL8",  "%s", 1, "NULL");  /* CCDINFO    */
+  fits_modify (&theader, "TNULL9",  "%s", 1, "NULL");  /* MODE       */
+  fits_modify (&theader, "TNULL10", "%s", 1, "-1");    /* VERSION    */
+  fits_modify (&theader, "TNULL11", "%s", 1, "-1");    /* ORDER      */
+  fits_modify (&theader, "TNULL12", "%s", 1, "NULL");  /* LABEL      */
+  fits_modify (&theader, "TNULL13", "%s", 1, "NULL");  /* PATH       */
 
   fits_modify (&theader, "TNVAL1",  "%s", 1, "NA");    /* KEY        */
@@ -111,9 +113,10 @@
   fits_modify (&theader, "TNVAL6",  "%s", 1, "NA");    /* IMAGETYP   */
   fits_modify (&theader, "TNVAL7",  "%s", 1, "NA");    /* FILTER     */
-  fits_modify (&theader, "TNVAL8",  "%s", 1, "NA");    /* CCDID      */
-  fits_modify (&theader, "TNVAL9",  "%s", 1, "-2");    /* VERSION    */
-  fits_modify (&theader, "TNVAL10", "%s", 1, "-2");    /* ORDER      */
-  fits_modify (&theader, "TNVAL11", "%s", 1, "NA");    /* LABEL      */
-  fits_modify (&theader, "TNVAL12", "%s", 1, "NA");    /* PATH       */
+  fits_modify (&theader, "TNVAL8",  "%s", 1, "NA");    /* CCDINFO    */
+  fits_modify (&theader, "TNVAL9",  "%s", 1, "NA");    /* MODE       */
+  fits_modify (&theader, "TNVAL10",  "%s", 1, "-2");    /* VERSION    */
+  fits_modify (&theader, "TNVAL11", "%s", 1, "-2");    /* ORDER      */
+  fits_modify (&theader, "TNVAL12", "%s", 1, "NA");    /* LABEL      */
+  fits_modify (&theader, "TNVAL13", "%s", 1, "NA");    /* PATH       */
 
   /* create table, add data values */
@@ -139,9 +142,16 @@
     regstr   = sec_to_date (newdata[0].treg);
     typestr  = typename[newdata[0].type];
+    modestr  = modename[newdata[0].mode];
     filtstr  = filterhash[newdata[0].filter];
-    ccdstr   = ccds[newdata[0].ccd];
+
+    if (newdata[0].mode == M_SPLIT) {
+      ccdstr   = ccds[newdata[0].ccd];
+    } else {
+      sprintf (ccdinfo, "%-3d", newdata[0].ccd);
+      ccdstr   = ccdinfo;
+    }
 
     line = fits_table_print (&table, key, startstr, stopstr, regstr, 
-			     newdata[0].exptime, typestr, filtstr, ccdstr,
+			     newdata[0].exptime, typestr, filtstr, ccdstr, modestr,
 			     newdata[0].Nentry, newdata[0].Norder, 
 			     newdata[0].label, newdata[0].filename);
@@ -171,7 +181,9 @@
   
   char *dBPath, *typestr, *filtstr;
-  char *timestr;
-  int i, j;
-
+  char *timestr, *modestr, *ccdstr, ccdinfo[16], ccdformat[16];
+  int i, j, Nc;
+
+  Nc = strlen (ccds[0]);
+  sprintf (ccdformat, "%%%dd", Nc);
   dBPath = get_dBPath ();
 
@@ -195,5 +207,13 @@
 
     typestr = typename[MIN (MAX (detdata[i].type, 0), NTYPE - 1)];
+    modestr = modename[MIN (MAX (detdata[i].mode, 0), NMODE - 1)];
     filtstr = filterhash[MIN (MAX (detdata[i].filter, 0), NFILTER - 1)];
+
+    if (detdata[i].mode == M_SPLIT) {
+      ccdstr   = ccds[detdata[i].ccd];
+    } else {
+      sprintf (ccdinfo, ccdformat, detdata[i].ccd);
+      ccdstr   = ccdinfo;
+    }
 
     /* output mode (Select vs List) */
@@ -201,6 +221,6 @@
       fprintf (stdout, "%s/%s\n", dBPath, detdata[i].filename);
     } else {
-      fprintf (stdout, "%-40s = %19s %7s %6s %02d %2d %2d %6.1f  %20s\n", 
-	       detdata[i].filename, timestr, typestr, filtstr, detdata[i].ccd, 
+      fprintf (stdout, "%-40s = %19s %7s %6s %6s %s %2d %2d %6.1f  %20s\n", 
+	       detdata[i].filename, timestr, modestr, typestr, filtstr, ccdstr,
 	       detdata[i].Nentry, detdata[i].Norder, detdata[i].exptime, detdata[i].label);
     }
