Index: /branches/eam_branches/ipp-20121219/Ohana/src/relphot/include/relphot.h
===================================================================
--- /branches/eam_branches/ipp-20121219/Ohana/src/relphot/include/relphot.h	(revision 34887)
+++ /branches/eam_branches/ipp-20121219/Ohana/src/relphot/include/relphot.h	(revision 34888)
@@ -107,4 +107,5 @@
   unsigned int tzero;
   unsigned char trate;
+  short ubercalDist;
 } ImageSubset;
 
Index: /branches/eam_branches/ipp-20121219/Ohana/src/relphot/src/ImageOps.c
===================================================================
--- /branches/eam_branches/ipp-20121219/Ohana/src/relphot/src/ImageOps.c	(revision 34887)
+++ /branches/eam_branches/ipp-20121219/Ohana/src/relphot/src/ImageOps.c	(revision 34888)
@@ -96,4 +96,5 @@
     image[i].tzero         = input[i].tzero        ;
     image[i].trate         = input[i].trate        ;
+    image[i].ubercalDist   = input[i].ubercalDist  ;
   }
   LineNumber = line_number;
@@ -128,4 +129,5 @@
     subset[i].tzero         = image[i].tzero        ;
     subset[i].trate         = image[i].trate        ;
+    subset[i].ubercalDist   = image[i].ubercalDist  ;
   }
   return subset;
Index: /branches/eam_branches/ipp-20121219/Ohana/src/relphot/src/ImageSubset.c
===================================================================
--- /branches/eam_branches/ipp-20121219/Ohana/src/relphot/src/ImageSubset.c	(revision 34887)
+++ /branches/eam_branches/ipp-20121219/Ohana/src/relphot/src/ImageSubset.c	(revision 34888)
@@ -65,4 +65,5 @@
   GET_COLUMN (tzero,   "TZERO",      int);
   GET_COLUMN (trate,   "TRATE",      short);
+  GET_COLUMN (ucdist,  "UBERCAL_DIST", short);
 
   // XXX free the fits table data here 
@@ -77,4 +78,5 @@
     image[i].tzero         = tzero[i];
     image[i].trate         = trate[i];
+    image[i].ubercalDist   = ucdist[i];
   }
   fprintf (stderr, "loaded data for %lld images\n", (long long) Nrow);
@@ -87,4 +89,5 @@
   free (tzero);
   free (trate);
+  free (ucdist);
 
   *nimage = Nrow;
@@ -124,4 +127,6 @@
   gfits_define_bintable_column (&theader, "I", "TRATE", "tti rate", NULL, 1.0, 0.0);
 
+  gfits_define_bintable_column (&theader, "I", "UBERCAL_DIST", "ubercal distance", NULL, 1.0, 1.0*0x80);
+
   // generate the output array that carries the data
   gfits_create_table (&theader, &ftable);
@@ -130,4 +135,5 @@
   unsigned int *imageID, *map, *flags, *tzero;
   unsigned short *trate;
+  short *ucdist;
 
   // create intermediate storage arrays
@@ -139,4 +145,5 @@
   ALLOCATE (tzero,   unsigned int,   Nimage);
   ALLOCATE (trate,   unsigned short, Nimage);
+  ALLOCATE (ucdist,  short,          Nimage);
 
   // assign the storage arrays
@@ -149,14 +156,16 @@
     tzero[i]   = image[i].tzero;
     trate[i]   = image[i].trate;
+    ucdist[i]  = image[i].ubercalDist;
   }
 
   // add the columns to the output array
-  gfits_set_bintable_column (&theader, &ftable, "MCAL",       Mcal,    Nimage);
-  gfits_set_bintable_column (&theader, &ftable, "MCAL_ERR",   dMcal,   Nimage);
-  gfits_set_bintable_column (&theader, &ftable, "IMAGE_ID",   imageID, Nimage);
-  gfits_set_bintable_column (&theader, &ftable, "PHOTOM_MAP", map,     Nimage);
-  gfits_set_bintable_column (&theader, &ftable, "FLAGS",      flags,   Nimage);
-  gfits_set_bintable_column (&theader, &ftable, "TZERO",      tzero,   Nimage);
-  gfits_set_bintable_column (&theader, &ftable, "TRATE",      trate,   Nimage);
+  gfits_set_bintable_column (&theader, &ftable, "MCAL",         Mcal,    Nimage);
+  gfits_set_bintable_column (&theader, &ftable, "MCAL_ERR",     dMcal,   Nimage);
+  gfits_set_bintable_column (&theader, &ftable, "IMAGE_ID",     imageID, Nimage);
+  gfits_set_bintable_column (&theader, &ftable, "PHOTOM_MAP",   map,     Nimage);
+  gfits_set_bintable_column (&theader, &ftable, "FLAGS",        flags,   Nimage);
+  gfits_set_bintable_column (&theader, &ftable, "TZERO",        tzero,   Nimage);
+  gfits_set_bintable_column (&theader, &ftable, "TRATE",        trate,   Nimage);
+  gfits_set_bintable_column (&theader, &ftable, "UBERCAL_DIST", ucdist,  Nimage);
 
   free (Mcal);
@@ -167,4 +176,5 @@
   free (tzero);
   free (trate);
+  free (ucdist);
 
   FILE *f = fopen (filename, "w");
