Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/include/addstar.h
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/include/addstar.h	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/include/addstar.h	(revision 38444)
@@ -84,6 +84,7 @@
 char   GSCFILE[256];
 char  *CATDIR;
-char   CATMODE[16];    /* raw, mef, split, mysql */
-char   CATFORMAT[16];  /* internal, elixir, loneos, panstarrs */
+char   CATMODE[16];     /* raw, mef, split, mysql */
+char   CATFORMAT[16];   /* internal, elixir, loneos, panstarrs */
+char   CATCOMPRESS[16]; /* GZIP_1, NONE */
 char   TWO_MASS_DIR_AS[256];
 char   TWO_MASS_DIR_DR2[256];
@@ -325,5 +326,4 @@
 void *memrchr(const void *s, int c, size_t n);
 int addstar_create_ID ();
-int strextend (char *input, char *format,...);
 
 void initMosaicCoords ();
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/ConfigInit.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/ConfigInit.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/ConfigInit.c	(revision 38444)
@@ -134,4 +134,7 @@
   ScanConfig (config, "CATMODE",                "%s",  0, CATMODE);
   ScanConfig (config, "CATFORMAT",              "%s",  0, CATFORMAT);
+  if (!ScanConfig (config, "CATCOMPRESS",       "%s",  0, CATCOMPRESS)) {
+    strcpy (CATCOMPRESS, "NONE");
+  }
   if (!ScanConfig (config, "SKY_DEPTH",         "%d",  0, &SKY_DEPTH)) {
     SKY_DEPTH = SKY_DEPTH_HST;
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/ReadStarsFITS.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/ReadStarsFITS.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/ReadStarsFITS.c	(revision 38444)
@@ -153,11 +153,9 @@
   off_t Nstars;
   unsigned int i;
-  char swapped;
   double ZeroPt;
   Stars *stars = NULL;
   SMPData *smpdata = NULL;
 
-  swapped = FALSE;
-  smpdata = gfits_table_get_SMPData (table, &Nstars, &swapped);
+  smpdata = gfits_table_get_SMPData (table, &Nstars, NULL, NULL);
   if (!smpdata) {
     fprintf (stderr, "skipping inconsistent entry\n");
@@ -229,5 +227,5 @@
   PS1_DEV_0 *ps1data;
 
-  ps1data = gfits_table_get_PS1_DEV_0 (table, &Nstars, NULL);
+  ps1data = gfits_table_get_PS1_DEV_0 (table, &Nstars, NULL, NULL);
   if (!ps1data) {
     fprintf (stderr, "skipping inconsistent entry\n");
@@ -300,5 +298,5 @@
   PS1_DEV_1 *ps1data;
 
-  ps1data = gfits_table_get_PS1_DEV_1 (table, &Nstars, NULL);
+  ps1data = gfits_table_get_PS1_DEV_1 (table, &Nstars, NULL, NULL);
   if (!ps1data) {
     fprintf (stderr, "skipping inconsistent entry\n");
@@ -383,5 +381,5 @@
   }
 
-  ps1data = gfits_table_get_CMF_PS1_V1 (table, &Nstars, NULL);
+  ps1data = gfits_table_get_CMF_PS1_V1 (table, &Nstars, NULL, NULL);
   if (!ps1data) {
     fprintf (stderr, "skipping inconsistent entry\n");
@@ -545,5 +543,5 @@
   CMF_PS1_V2 *ps1data;
 
-  ps1data = gfits_table_get_CMF_PS1_V2 (table, &Nstars, NULL);
+  ps1data = gfits_table_get_CMF_PS1_V2 (table, &Nstars, NULL, NULL);
   if (!ps1data) {
     fprintf (stderr, "skipping inconsistent entry\n");
@@ -622,5 +620,5 @@
   CMF_PS1_V3 *ps1data;
 
-  ps1data = gfits_table_get_CMF_PS1_V3 (table, &Nstars, NULL);
+  ps1data = gfits_table_get_CMF_PS1_V3 (table, &Nstars, NULL, NULL);
   if (!ps1data) {
     fprintf (stderr, "skipping inconsistent entry\n");
@@ -706,5 +704,5 @@
   CMF_PS1_V4 *ps1data;
 
-  ps1data = gfits_table_get_CMF_PS1_V4 (table, &Nstars, NULL);
+  ps1data = gfits_table_get_CMF_PS1_V4 (table, &Nstars, NULL, NULL);
   if (!ps1data) {
     fprintf (stderr, "skipping inconsistent entry\n");
@@ -1259,5 +1257,5 @@
   }
 
-  ps1data = gfits_table_get_CMF_PS1_SV1 (table, &Nstars, NULL);
+  ps1data = gfits_table_get_CMF_PS1_SV1 (table, &Nstars, NULL, NULL);
   if (!ps1data) {
     fprintf (stderr, "skipping inconsistent entry\n");
@@ -1423,5 +1421,5 @@
   CMF_PS1_SV2 *ps1data;
 
-  ps1data = gfits_table_get_CMF_PS1_SV2 (table, &Nstars, NULL);
+  ps1data = gfits_table_get_CMF_PS1_SV2 (table, &Nstars, NULL, NULL);
   if (!ps1data) {
     fprintf (stderr, "skipping inconsistent entry\n");
@@ -1753,5 +1751,5 @@
   CMF_PS1_DV4 *ps1data;
 
-  ps1data = gfits_table_get_CMF_PS1_DV4 (table, &Nstars, NULL);
+  ps1data = gfits_table_get_CMF_PS1_DV4 (table, &Nstars, NULL, NULL);
   if (!ps1data) {
     fprintf (stderr, "skipping inconsistent entry\n");
@@ -1839,5 +1837,5 @@
   CMF_PS1_DV5 *ps1data;
 
-  ps1data = gfits_table_get_CMF_PS1_DV5 (table, &Nstars, NULL);
+  ps1data = gfits_table_get_CMF_PS1_DV5 (table, &Nstars, NULL, NULL);
   if (!ps1data) {
     fprintf (stderr, "skipping inconsistent entry\n");
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/SEDfit.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/SEDfit.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/SEDfit.c	(revision 38444)
@@ -198,5 +198,5 @@
   outcat[0].Naverage  = Nave;
   outcat[0].Nmeasure  = Nmeas;
-  outcat[0].Nsecf_mem = Nave*Nsec;
+  outcat[0].Nsecfilt_mem = Nave*Nsec;
   
   free (sourceValue.mags);
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/UpdateDatabase_Image.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/UpdateDatabase_Image.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/UpdateDatabase_Image.c	(revision 38444)
@@ -12,6 +12,6 @@
   }
 
-  catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
-  if (options[0].update) catalog.catflags = LOAD_AVES | LOAD_MISS | LOAD_SECF;
+  catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
+  if (options[0].update) catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
   
   // XXX this is probably not needed anymore
@@ -47,6 +47,6 @@
     catalog.filename  = skylist[0].filename[i];
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
-    catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
-    if (options[0].update) catalog.catflags = LOAD_AVES | LOAD_MISS | LOAD_SECF;
+    catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
+    if (options[0].update) catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
 
     // an error exit status here is a significant error
@@ -56,7 +56,7 @@
     }
 
-    // Naves_disk == 0 implies an empty catalog file
+    // Naverage_disk == 0 implies an empty catalog file
     // for only_match, skip empty catalogs 
-    if ((catalog.Naves_disk == 0) && options[0].only_match) {
+    if ((catalog.Naverage_disk == 0) && options[0].only_match) {
       dvo_catalog_unlock (&catalog);
       dvo_catalog_free (&catalog);
@@ -73,5 +73,5 @@
       SetProtect (TRUE);
       if (options[0].update) {
-	catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
+	catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
 	dvo_catalog_update (&catalog, VERBOSE);
       } else {
@@ -92,4 +92,5 @@
     /*** update the image table ***/
     /* setup image table format and lock */
+    gfits_db_init (&db);
     db.mode   = dvo_catalog_catmode (CATMODE);
     db.format = dvo_catalog_catformat (CATFORMAT);
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/UpdateDatabase_Refcat.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/UpdateDatabase_Refcat.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/UpdateDatabase_Refcat.c	(revision 38444)
@@ -36,6 +36,6 @@
     catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
     catalog.catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
-    catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
-    if (options[0].update) catalog.catflags = LOAD_AVES | LOAD_MISS | LOAD_SECF;
+    catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
+    if (options[0].update) catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
   
     // an error exit status here is a significant error
@@ -45,7 +45,7 @@
     }
 
-    // Naves_disk == 0 implies an empty catalog file
+    // Naverage_disk == 0 implies an empty catalog file
     // for only_match, skip empty catalogs
-    if ((catalog.Naves_disk == 0) && options[0].only_match) {
+    if ((catalog.Naverage_disk == 0) && options[0].only_match) {
       dvo_catalog_unlock (&catalog);
       dvo_catalog_free (&catalog);
@@ -63,5 +63,5 @@
       SetProtect (TRUE);
       if (options[0].update) {
-	catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
+	catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
 	dvo_catalog_update (&catalog, VERBOSE);
       } else {
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/UpdateDatabase_Reflist.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/UpdateDatabase_Reflist.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/UpdateDatabase_Reflist.c	(revision 38444)
@@ -36,6 +36,6 @@
     catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
     catalog.catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
-    catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
-    if (options[0].update) catalog.catflags = LOAD_AVES | LOAD_MISS | LOAD_SECF;
+    catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
+    if (options[0].update) catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
 
     // an error exit status here is a significant error
@@ -46,5 +46,5 @@
 
     /* for only_match, skip empty catalogs XXX EAM : this leaves behind empty files */
-    if ((catalog.Naves_disk == 0) && options[0].only_match) {
+    if ((catalog.Naverage_disk == 0) && options[0].only_match) {
       dvo_catalog_unlock (&catalog);
       dvo_catalog_free (&catalog);
@@ -59,5 +59,5 @@
       SetProtect (TRUE);
       if (options[0].update) {
-	catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
+	catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
 	dvo_catalog_update (&catalog, VERBOSE);
       } else {
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/UpdateImageIDs.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/UpdateImageIDs.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/UpdateImageIDs.c	(revision 38444)
@@ -9,4 +9,5 @@
   /*** update the image table ***/
   /* setup image table format and lock */
+  gfits_db_init (&db);
   db.mode   = dvo_catalog_catmode (CATMODE);
   db.format = dvo_catalog_catformat (CATFORMAT);
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/addstar.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/addstar.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/addstar.c	(revision 38444)
@@ -104,9 +104,10 @@
 
     // set the parameters which guide catalog open/load/create
-    catalog.filename  = skylist[0].filename[i];
-    catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
-    catalog.catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
-    catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF | LOAD_LENSING;
-    catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
+    catalog.filename    = skylist[0].filename[i];
+    catalog.catmode     = dvo_catalog_catmode (CATMODE);         // set the default catmode from config data
+    catalog.catformat   = dvo_catalog_catformat (CATFORMAT);     // set the default catformat from config data
+    catalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
+    catalog.catflags    = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT | DVO_LOAD_LENSING;
+    catalog.Nsecfilt    = GetPhotcodeNsecfilt ();
 
     // XXX need to do something to enforce consistency.  we can change options.update
@@ -117,5 +118,5 @@
     if (catalog.catmode != DVO_MODE_SPLIT) options.update = FALSE;
 
-    if (options.update) catalog.catflags = LOAD_AVES | LOAD_MISS | LOAD_SECF;
+    if (options.update) catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
 
     // open as read or write, depending on desire
@@ -134,7 +135,7 @@
     if (VERBOSE) MARKTIME ("load cpt: %f sec\n", dtime); RESETTIME; 
 
-    // Naves_disk == 0 implies an empty catalog file
+    // Naverage_disk == 0 implies an empty catalog file
     // for only_match, skip empty catalogs
-    if ((catalog.Naves_disk == 0) && options.only_match) {
+    if ((catalog.Naverage_disk == 0) && options.only_match) {
       dvo_catalog_unlock (&catalog);
       dvo_catalog_free (&catalog);
@@ -174,5 +175,5 @@
       SetProtect (TRUE);
       if (options.update) {
-	catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF | LOAD_LENSING;
+	catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT | DVO_LOAD_LENSING;
 	dvo_catalog_update (&catalog, VERBOSE);
       } else {
@@ -193,4 +194,5 @@
   /*** update the image table ***/
   /* setup image table format and lock */
+  gfits_db_init (&db);
   db.mode   = dvo_catalog_catmode (CATMODE);
   db.format = dvo_catalog_catformat (CATFORMAT);
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/addstar_create_ID.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/addstar_create_ID.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/addstar_create_ID.c	(revision 38444)
@@ -10,5 +10,5 @@
   /*** update the image table ***/
   /* setup image table format and lock */
-  // gfits_db_init (&db);
+  gfits_db_init (&db);
   db.mode   = dvo_catalog_catmode (CATMODE);
   db.format = dvo_catalog_catformat (CATFORMAT);
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/args.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/args.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/args.c	(revision 38444)
@@ -480,17 +480,4 @@
 }
 
-int strextend (char *input, char *format,...) {
-
-  char tmpextra[1024], tmpline[1024];
-  va_list argp;
-
-  va_start (argp, format);
-  vsnprintf (tmpextra, 1024, format, argp);
-  snprintf (tmpline, 1024, "%s %s", input, tmpextra);
-  strcpy (input, tmpline);
-
-  return TRUE;
-}
-
 /** addstar modes:
  
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/args_parallel_client.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/args_parallel_client.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/args_parallel_client.c	(revision 38444)
@@ -125,15 +125,2 @@
 }
 
-int strextend (char *input, char *format,...) {
-
-  char tmpextra[1024], tmpline[1024];
-  va_list argp;
-
-  va_start (argp, format);
-  vsnprintf (tmpextra, 1024, format, argp);
-  snprintf (tmpline, 1024, "%s %s", input, tmpextra);
-  strcpy (input, tmpline);
-
-  return TRUE;
-}
-
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/dumpskycells.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/dumpskycells.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/dumpskycells.c	(revision 38444)
@@ -46,4 +46,5 @@
   /*** open the image table ***/
   /* setup image table format and lock */
+  gfits_db_init (&db);
   db.mode   = dvo_catalog_catmode (CATMODE);
   db.format = dvo_catalog_catformat (CATFORMAT);
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/find_matches.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/find_matches.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/find_matches.c	(revision 38444)
@@ -91,5 +91,5 @@
 
   /* set up pointers for linked list of measure */
-  if (catalog[0].sorted && (catalog[0].Nmeasure == catalog[0].Nmeas_disk)) {
+  if (catalog[0].sorted && (catalog[0].Nmeasure == catalog[0].Nmeasure_disk)) {
     next_meas = init_measure_links (catalog[0].average, Nave, catalog[0].measure, Nmeas);
   } else {
@@ -316,5 +316,5 @@
   catalog[0].Naverage = Nave;
   catalog[0].Nmeasure = Nmeas;
-  catalog[0].Nsecf_mem = Nave*Nsecfilt;
+  catalog[0].Nsecfilt_mem = Nave*Nsecfilt;
   if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas: "OFF_T_FMT" "OFF_T_FMT" "OFF_T_FMT", ("OFF_T_FMT" matches)\n",  Nstars,  Nave,  Nmeas,  Nmatch);
 
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/find_matches_ICRF.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/find_matches_ICRF.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/find_matches_ICRF.c	(revision 38444)
@@ -164,5 +164,5 @@
   catalog[0].Naverage  = Nave;
   catalog[0].Nmeasure  = Nmeas;
-  catalog[0].Nsecf_mem = Nave*Nsecfilt;
+  catalog[0].Nsecfilt_mem = Nave*Nsecfilt;
   if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas: %d "OFF_T_FMT" "OFF_T_FMT" ("OFF_T_FMT" matches)\n",  Nstars, Nave, Nmeas, Nmatch);
 
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/find_matches_closest.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/find_matches_closest.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/find_matches_closest.c	(revision 38444)
@@ -91,5 +91,5 @@
 
   /* set up pointers for linked list of measure */
-  if (catalog[0].sorted && (catalog[0].Nmeasure == catalog[0].Nmeas_disk)) {
+  if (catalog[0].sorted && (catalog[0].Nmeasure == catalog[0].Nmeasure_disk)) {
     // this version is only valid if we have done a full catalog load, and if the catalog
     // is sorted while processed
@@ -376,5 +376,5 @@
   catalog[0].Nmeasure = Nmeas;
   catalog[0].Nlensing = Nlens;
-  catalog[0].Nsecf_mem = Nave*Nsecfilt;
+  catalog[0].Nsecfilt_mem = Nave*Nsecfilt;
   if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas, Nlens: "OFF_T_FMT" "OFF_T_FMT" "OFF_T_FMT" "OFF_T_FMT", ("OFF_T_FMT" matches)\n",  Nstars,  Nave,  Nmeas,  Nlens, Nmatch);
 
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/find_matches_closest_refstars.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/find_matches_closest_refstars.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/find_matches_closest_refstars.c	(revision 38444)
@@ -100,5 +100,5 @@
 
   /* set up pointers for linked list of measure */
-  if (catalog[0].sorted && (catalog[0].Nmeasure == catalog[0].Nmeas_disk)) {
+  if (catalog[0].sorted && (catalog[0].Nmeasure == catalog[0].Nmeasure_disk)) {
     // this version is only valid if we have done a full catalog load, and if the catalog
     // is sorted while processed
@@ -342,5 +342,5 @@
   catalog[0].Naverage = Nave;
   catalog[0].Nmeasure = Nmeas;
-  catalog[0].Nsecf_mem = Nave*Nsecfilt;
+  catalog[0].Nsecfilt_mem = Nave*Nsecfilt;
   if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas: "OFF_T_FMT" "OFF_T_FMT" "OFF_T_FMT", ("OFF_T_FMT" matches)\n",  Nstars,  Nave,  Nmeas,  Nmatch);
 
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/find_matches_refstars.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/find_matches_refstars.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/find_matches_refstars.c	(revision 38444)
@@ -70,5 +70,5 @@
 
   /* set up pointers for linked list of measurements */
-  if (catalog[0].sorted && (catalog[0].Nmeasure == catalog[0].Nmeas_disk)) {
+  if (catalog[0].sorted && (catalog[0].Nmeasure == catalog[0].Nmeasure_disk)) {
     // this version is only valid if we have done a full catalog load, and if the catalog
     // is sorted while processed
@@ -293,5 +293,5 @@
   catalog[0].Naverage = Nave;
   catalog[0].Nmeasure = Nmeas;
-  catalog[0].Nsecf_mem = Nave*Nsecfilt;
+  catalog[0].Nsecfilt_mem = Nave*Nsecfilt;
   if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas: %d "OFF_T_FMT" "OFF_T_FMT", ("OFF_T_FMT" matches)\n",  Nstars,  Nave,  Nmeas,  Nmatch);
 
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/find_matches_starpar.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/find_matches_starpar.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/find_matches_starpar.c	(revision 38444)
@@ -205,5 +205,5 @@
   catalog[0].Naverage  = Nave;
   catalog[0].Nstarpar  = Nstarpar;
-  catalog[0].Nsecf_mem = Nave*Nsecfilt;
+  catalog[0].Nsecfilt_mem = Nave*Nsecfilt;
   if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nstarpar: %d "OFF_T_FMT" "OFF_T_FMT" ("OFF_T_FMT" matches)\n",  Nstars, Nave, Nstarpar, Nmatch);
 
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/findskycell.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/findskycell.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/findskycell.c	(revision 38444)
@@ -173,4 +173,5 @@
   snprintf (imagefile, DVO_MAX_PATH, "%s/Images.dat", catdir);
 
+  gfits_db_init (&db);
   status = dvo_image_lock (&db, imagefile, 2.0, LCK_XCLD);
   if (!status) Shutdown ("ERROR: failure to lock image catalog %s", db.filename);
@@ -183,5 +184,5 @@
   // convert database table to internal structure (binary to Image)
   // 'image' points to the same memory as db->ftable->buffer
-  image = gfits_table_get_Image (&db.ftable, &Nimage, &db.swapped);
+  image = gfits_table_get_Image (&db.ftable, &Nimage, &db.scaledValue, &db.nativeOrder);
   if (!image) {
       fprintf (stderr, "ERROR: failed to read images\n");
@@ -557,4 +558,5 @@
   snprintf (imagefile, DVO_MAX_PATH, "%s/Images.dat", catdir);
 
+  gfits_db_init (&db);
   status = dvo_image_lock (&db, imagefile, 2.0, LCK_XCLD);
   if (!status) Shutdown ("ERROR: failure to lock image catalog %s", db.filename);
@@ -567,5 +569,5 @@
   // convert database table to internal structure (binary to Image)
   // 'image' points to the same memory as db->ftable->buffer
-  image = gfits_table_get_Image (&db.ftable, &Nimage, &db.swapped);
+  image = gfits_table_get_Image (&db.ftable, &Nimage, &db.scaledValue, &db.nativeOrder);
   if (!image) {
     fprintf (stderr, "ERROR: failed to read images\n");
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/load2mass_as_rawdata.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/load2mass_as_rawdata.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/load2mass_as_rawdata.c	(revision 38444)
@@ -181,5 +181,5 @@
 	catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
 	catalog.catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
-	catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
+	catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
 	catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
 
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/load2mass_catalog.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/load2mass_catalog.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/load2mass_catalog.c	(revision 38444)
@@ -56,5 +56,5 @@
   catalog[0].Naverage = Nave;
   catalog[0].Nmeasure = Nmeas;
-  catalog[0].Nsecf_mem = Nave*Nsec;
+  catalog[0].Nsecfilt_mem = Nave*Nsec;
   return (TRUE);
 }
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadICRF_catalog.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadICRF_catalog.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadICRF_catalog.c	(revision 38444)
@@ -10,5 +10,5 @@
   catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
   catalog.catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
-  catalog.catflags = LOAD_AVES | LOAD_SECF | LOAD_MEAS;
+  catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_SECFILT | DVO_LOAD_MEASURE;
   catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
     
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadICRF_save_remote.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadICRF_save_remote.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadICRF_save_remote.c	(revision 38444)
@@ -2,17 +2,4 @@
 # include "loadICRF.h"
 # define DEBUG 1
-
-int strextend (char *input, char *format,...) {
-
-  char tmpextra[1024], tmpline[1024];
-  va_list argp;
-
-  va_start (argp, format);
-  vsnprintf (tmpextra, 1024, format, argp);
-  snprintf (tmpline, 1024, "%s %s", input, tmpextra);
-  strcpy (input, tmpline);
-
-  return TRUE;
-}
 
 int loadICRF_save_remote (ICRF_Stars *stars, int Nstars, HostTable *hosts, SkyRegion *region, char *fullname, AddstarClientOptions *options) {
@@ -64,12 +51,12 @@
 
     // need to generate the remote command
-    char command[1024];
-    snprintf (command, 1024, "loadICRF_client");
-    strextend (command, "-hostID %d", host->hostID);
-    strextend (command, "-D CATDIR %s", CATDIR);
-    strextend (command, "-hostdir %s", host->pathname);
-    strextend (command, "-cpt %s", region->name);
-    strextend (command, "-input %s", filename);
-    strextend (command, "-D ADDSTAR_RADIUS %f", options->radius);
+    char *command = NULL;
+    strextend (&command, "loadICRF_client");
+    strextend (&command, "-hostID %d", host->hostID);
+    strextend (&command, "-D CATDIR %s", CATDIR);
+    strextend (&command, "-hostdir %s", host->pathname);
+    strextend (&command, "-cpt %s", region->name);
+    strextend (&command, "-input %s", filename);
+    strextend (&command, "-D ADDSTAR_RADIUS %f", options->radius);
 
     fprintf (stderr, "command: %s\n", command);
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadICRF_table.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadICRF_table.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadICRF_table.c	(revision 38444)
@@ -1,8 +1,4 @@
 # include "addstar.h"
 # include "loadICRF.h"
-
-# define GET_COLUMN(OUT,NAME,TYPE) \
-  TYPE *OUT = gfits_get_bintable_column_data (&theader, &ftable, NAME, type, &Nrow, &Ncol); \
-  myAssert (!strcmp(type, #TYPE), "wrong column type");
 
 int loadICRF_table (SkyList *skylistInput, HostTable *hosts, char *filename, AddstarClientOptions *options) {
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadstarpar_catalog.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadstarpar_catalog.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadstarpar_catalog.c	(revision 38444)
@@ -10,5 +10,5 @@
   catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
   catalog.catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
-  catalog.catflags = LOAD_AVES | LOAD_SECF | LOAD_STARPAR;
+  catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_SECFILT | DVO_LOAD_STARPAR;
   catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
     
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadstarpar_save_remote.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadstarpar_save_remote.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadstarpar_save_remote.c	(revision 38444)
@@ -2,17 +2,4 @@
 # include "loadstarpar.h"
 # define DEBUG 1
-
-int strextend (char *input, char *format,...) {
-
-  char tmpextra[1024], tmpline[1024];
-  va_list argp;
-
-  va_start (argp, format);
-  vsnprintf (tmpextra, 1024, format, argp);
-  snprintf (tmpline, 1024, "%s %s", input, tmpextra);
-  strcpy (input, tmpline);
-
-  return TRUE;
-}
 
 int loadstarpar_save_remote (StarPar_Stars *stars, int Nstars, HostTable *hosts, SkyRegion *region, char *fullname, AddstarClientOptions *options) {
@@ -62,11 +49,11 @@
 
     // need to generate the remote command
-    char command[1024];
-    snprintf (command, 1024, "loadstarpar_client");
-    strextend (command, "-hostID %d", host->hostID);
-    strextend (command, "-D CATDIR %s", CATDIR);
-    strextend (command, "-hostdir %s", host->pathname);
-    strextend (command, "-cpt %s", region->name);
-    strextend (command, "-input %s", filename);
+    char *command = NULL;
+    strextend (&command, "loadstarpar_client");
+    strextend (&command, "-hostID %d", host->hostID);
+    strextend (&command, "-D CATDIR %s", CATDIR);
+    strextend (&command, "-hostdir %s", host->pathname);
+    strextend (&command, "-cpt %s", region->name);
+    strextend (&command, "-input %s", filename);
 
     // launch the job on the remote machine (no handshake)
@@ -78,4 +65,5 @@
     }
     host->pid = pid; // save for future reference
+    free (command);
     
     save_remote_host (host);
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadstarpar_table.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadstarpar_table.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadstarpar_table.c	(revision 38444)
@@ -1,8 +1,4 @@
 # include "addstar.h"
 # include "loadstarpar.h"
-
-# define GET_COLUMN(OUT,NAME,TYPE) \
-  TYPE *OUT = gfits_get_bintable_column_data (&theader, &ftable, NAME, type, &Nrow, &Ncol); \
-  myAssert (!strcmp(type, #TYPE), "wrong column type");
 
 int loadstarpar_table (SkyList *skylistInput, HostTable *hosts, char *filename, AddstarClientOptions *options) {
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadsupercos.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadsupercos.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadsupercos.c	(revision 38444)
@@ -47,4 +47,5 @@
 
   // attempt to open the existing images table.  if it does not exist, we will save the loaded images
+  gfits_db_init (&db);
   db.mode   = dvo_catalog_catmode (CATMODE);
   db.format = dvo_catalog_catformat (CATFORMAT);
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadsupercos_rawdata.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadsupercos_rawdata.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadsupercos_rawdata.c	(revision 38444)
@@ -171,5 +171,5 @@
 	catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
 	catalog.catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
-	catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
+	catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
 	catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
 
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadwise_prelim_rawdata.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadwise_prelim_rawdata.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadwise_prelim_rawdata.c	(revision 38444)
@@ -186,5 +186,5 @@
 	catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
 	catalog.catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
-	catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
+	catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
 	catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
 
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadwise_rawdata.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadwise_rawdata.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/loadwise_rawdata.c	(revision 38444)
@@ -188,5 +188,5 @@
 	catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
 	catalog.catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
-	catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
+	catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
 	catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
 
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/mkcmf.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/mkcmf.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/mkcmf.c	(revision 38444)
@@ -500,5 +500,5 @@
   }
 
-  gfits_table_set_PS1_DEV_0 (ftable, stars, Nstars);
+  gfits_table_set_PS1_DEV_0 (ftable, stars, Nstars, TRUE);
   gfits_modify (ftable->header, "EXTTYPE",   "%s", 1, "PS1_DEV_0");
 }
@@ -547,5 +547,5 @@
   }
 
-  gfits_table_set_PS1_DEV_1 (ftable, stars, Nstars);
+  gfits_table_set_PS1_DEV_1 (ftable, stars, Nstars, TRUE);
   gfits_modify (ftable->header, "EXTTYPE",   "%s", 1, "PS1_DEV_1");
 }
@@ -596,5 +596,5 @@
   }
 
-  gfits_table_set_CMF_PS1_V1 (ftable, stars, Nstars);
+  gfits_table_set_CMF_PS1_V1 (ftable, stars, Nstars, TRUE);
   gfits_modify (ftable->header, "EXTTYPE",   "%s", 1, "PS1_V1");
 }
@@ -651,5 +651,5 @@
   }
 
-  gfits_table_set_CMF_PS1_V2 (ftable, stars, Nstars);
+  gfits_table_set_CMF_PS1_V2 (ftable, stars, Nstars, TRUE);
   gfits_modify (ftable->header, "EXTTYPE",   "%s", 1, "PS1_V2");
 }
@@ -710,5 +710,5 @@
   }
 
-  gfits_table_set_CMF_PS1_V3 (ftable, stars, Nstars);
+  gfits_table_set_CMF_PS1_V3 (ftable, stars, Nstars, TRUE);
   gfits_modify (ftable->header, "EXTTYPE",   "%s", 1, "PS1_V3");
 }
@@ -778,5 +778,5 @@
   }
 
-  gfits_table_set_CMF_PS1_V4 (ftable, stars, Nstars);
+  gfits_table_set_CMF_PS1_V4 (ftable, stars, Nstars, TRUE);
   gfits_modify (ftable->header, "EXTTYPE",   "%s", 1, "PS1_V4");
 }
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/resort_catalogs.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/resort_catalogs.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/resort_catalogs.c	(revision 38444)
@@ -74,16 +74,16 @@
     table->hosts[i].pathname = tmppath;
 
-    char command[1024];
-    snprintf (command, 1024, "addstar_client -resort");
-    strextend (command, "-D CATDIR %s", CATDIR);
-    strextend (command, "-hostID %d", table->hosts[i].hostID);
-    strextend (command, "-hostdir %s", table->hosts[i].pathname);
-    strextend (command, "-region %f %f %f %f", UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
+    char *command = NULL;
+    strextend (&command, "addstar_client -resort");
+    strextend (&command, "-D CATDIR %s", CATDIR);
+    strextend (&command, "-hostID %d", table->hosts[i].hostID);
+    strextend (&command, "-hostdir %s", table->hosts[i].pathname);
+    strextend (&command, "-region %f %f %f %f", UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
 
-    if (VERBOSE)                   strextend (command, "%s -v");
-    if (NTHREADS)                  strextend (command, "%s -threads %d", NTHREADS);
-    if (OLD_RESORT)                strextend (command, "%s -old-resort");
-    if (options->nosort == 3)      strextend (command, "%s -force-sort");
-    if (options->existing_regions) strextend (command, "%s -existing-regions");
+    if (VERBOSE)                   strextend (&command, "-v");
+    if (NTHREADS)                  strextend (&command, "-threads %d", NTHREADS);
+    if (OLD_RESORT)                strextend (&command, "-old-resort");
+    if (options->nosort == 3)      strextend (&command, "-force-sort");
+    if (options->existing_regions) strextend (&command, "-existing-regions");
 
     fprintf (stderr, "command: %s\n", command);
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/resort_threaded.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/resort_threaded.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/resort_threaded.c	(revision 38444)
@@ -43,8 +43,9 @@
 
     // set the parameters which guide catalog open/load/create
-    catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
-    catalog.catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
-    catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_LENSING;
-    catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
+    catalog.catformat   = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
+    catalog.catmode     = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
+    catalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
+    catalog.catflags    = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_LENSING;
+    catalog.Nsecfilt    = GetPhotcodeNsecfilt ();
   
     // an error exit status here is a significant error (disk I/O or file access)
@@ -57,6 +58,6 @@
     }
 
-    // Naves_disk == 0 implies an empty catalog file, skip empty catalogs
-    if (catalog.Naves_disk == 0) {
+    // Naverage_disk == 0 implies an empty catalog file, skip empty catalogs
+    if (catalog.Naverage_disk == 0) {
       dvo_catalog_unlock (&catalog);
       dvo_catalog_free (&catalog);
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/resort_unthreaded.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/resort_unthreaded.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/resort_unthreaded.c	(revision 38444)
@@ -21,8 +21,9 @@
 
     // set the parameters which guide catalog open/load/create
-    catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
-    catalog.catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
-    catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_LENSING;
-    catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
+    catalog.catformat   = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
+    catalog.catmode     = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
+    catalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
+    catalog.catflags    = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_LENSING;
+    catalog.Nsecfilt    = GetPhotcodeNsecfilt ();
 
     // an error exit status here is a significant error (disk I/O or file access)
@@ -32,6 +33,6 @@
     }
 
-    // Naves_disk == 0 implies an empty catalog file, skip empty catalogs
-    if (catalog.Naves_disk == 0) {
+    // Naverage_disk == 0 implies an empty catalog file, skip empty catalogs
+    if (catalog.Naverage_disk == 0) {
       dvo_catalog_unlock (&catalog);
       dvo_catalog_free (&catalog);
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/sedstar.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/sedstar.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/sedstar.c	(revision 38444)
@@ -26,5 +26,5 @@
   for (i = 0; i < skylist[0].Nregions; i++) {
     incatalog.filename = skylist[0].filename[i];
-    incatalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
+    incatalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
 
     // an error exit status here is a significant error
@@ -34,6 +34,6 @@
     }
 
-    // Naves_disk == 0 implies an empty catalog file
-    if ((incatalog.Naves_disk == 0) && options.only_match) {
+    // Naverage_disk == 0 implies an empty catalog file
+    if ((incatalog.Naverage_disk == 0) && options.only_match) {
       if (VERBOSE) fprintf (stderr, "skipping empty region\n");
       dvo_catalog_unlock (&incatalog);
@@ -54,5 +54,5 @@
     outcatalog.catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
     outcatalog.Nsecfilt  = GetPhotcodeNsecfilt ();
-    outcatalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
+    outcatalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
 
     // an error exit status here is a significant error
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/skycells.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/skycells.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/skycells.c	(revision 38444)
@@ -12,4 +12,5 @@
   /*** update the image table ***/
   /* setup image table format and lock */
+  gfits_db_init (&db);
   db.mode   = dvo_catalog_catmode (CATMODE);
   db.format = dvo_catalog_catformat (CATFORMAT);
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/skycells_to_mdc.c
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/skycells_to_mdc.c	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/src/skycells_to_mdc.c	(revision 38444)
@@ -5,5 +5,5 @@
     // Convert FITS_DB to images structure
     off_t NdbImages;
-    Image *dbImages = gfits_table_get_Image(&db->ftable, &NdbImages, &db->swapped);
+    Image *dbImages = gfits_table_get_Image(&db->ftable, &NdbImages, &db->scaledValue, &db->nativeOrder);
 
     // If tess_id was not supplied assume that it is the basename of the CATDIR
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/test/compress.dvo
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/test/compress.dvo	(revision 38444)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/test/compress.dvo	(revision 38444)
@@ -0,0 +1,434 @@
+# -*-sh-*-
+
+input tap.dvo
+$CATDIR = catdir.test.v0
+
+macro test.all
+  # test.fields (DVO schema) (CMF format)
+  local dvo_schema cmf_format cmpmode
+
+  foreach cmf_format PS1_DEV_0 PS1_DEV_1 PS1_V1 PS1_V2 PS1_V3 PS1_V5
+    foreach dvo_schema PS1_V1 PS1_V2 PS1_V3 PS1_V4
+      foreach cmpmode NONE GZIP_1 GZIP_2 RICE_1 AUTO
+        test.fields $cmf_format $dvo_schema $cmpmode
+      end
+    end
+  end
+end  
+
+if (not($?NO_NOISE)) 
+  $NO_NOISE = ""
+end
+
+# create a populated catdir with a single cmf -- test each field
+macro test.fields
+  if ($0 != 4)
+    echo "USAGE: test.fields (cmf_format) (dvo_schema) (cmpmode)"
+    break
+  end
+
+  echo ""
+  echo "testing --- CMF = $1, DVO = $2, CMPMODE = $3 ---"
+
+  exec rm -rf $CATDIR
+
+  $RA = 10.0
+  $DEC = 20.0
+
+  mkinput
+  tapEXEC mkcmf test.in.txt test.cmf -date 2008/1/1 -time 01:00:00 -radec $RA $DEC -type $1 $NO_NOISE
+  tapEXEC addstar -D CATCOMPRESS $3 -D CATDIR $CATDIR -D CAMERA simtest test.cmf -D CATFORMAT $2 -quick-airmass
+
+  list testfields -copy testfields_$1
+
+  # set the number of tests based on the testfields list
+  tapPLAN {3 + 3*($testfields:n - 1)}
+
+  catdir $CATDIR
+  skyregion {$RA-1.0} {$RA+1.0} {$DEC-1.0} {$DEC+1.0} 
+
+  data test.cmf
+
+  for i 0 $testfields:n
+    if ($TAP_VERBOSE) echo $testfields:$i
+    list name -split $testfields:$i
+    if ("$name:0" == "SKIP") continue
+    if ("$name:2" == "SKIP") continue
+ 
+    read -fits Chip.psf $name:0
+    mextract $name:2
+  end
+
+  # how is the detection ID?
+  list name -split $testfields:0
+  set ID1 = $name:0
+  set ID2 = $name:2
+  tapOK {ID1[] == ID2[]} "lengths for $name:0 vs $name:2"
+  if (not($TAP_LAST)) return
+
+  set d = $name:0 - $name:2
+  vstat -q d
+  tapOK {abs($MEAN)  < 0.001} "$name:0 vs $name:2 (MEAN = $MEAN)"
+  tapOK {abs($SIGMA) < 0.001} "$name:0 vs $name:2 (SIGMA = $SIGMA)"
+
+  # detection ID must be first for this to work:
+  for i 1 $testfields:n
+    list name -split $testfields:$i
+    if ("$name:0" == "SKIP") 
+      tapSKIP 3
+      continue
+    end
+    if ("$name:2" == "SKIP") 
+      tapSKIP 3
+      continue
+    end
+    # must be the same length
+    set v1 = $name:0
+    set v2 = $name:2
+    tapOK {v1[] == v2[]} "lengths for $name:0 vs $name:2"
+    if (not($TAP_LAST)) continue
+
+    set id1 = ID1
+    set id2 = ID2
+    sort id1 v1
+    sort id2 v2
+
+    # some fields require arithmetic manipulations
+    ## if ("$name:0" == "KRON_FLUX") 
+    ##  set v1 = -2.5*log(v1)
+    ## end
+    ## if ("$name:0" == "KRON_FLUX_ERR") 
+    ##  set v1 = KRON_FLUX_ERR / KRON_FLUX
+    ## end
+    if (("$name:0" == "X_PSF_SIG") || ("$name:0" == "Y_PSF_SIG"))
+     set v1 = int(100*(v1))
+     set v2 = int(100*(v2 + 0.0001))
+    end
+    if ("$name:0" == "POSANGLE")
+     set v1 = int((0xffff/360.0)*(v1))
+     set v2 = int((0xffff/360.0)*(v2 + 0.0028))
+    end
+
+    set d = v1 - v2
+    vstat -q d
+    
+    #echo tapOK fabs($MEAN)  < 0.001 "$name:0 vs $name:2 (MEAN)"
+    #echo tapOK fabs($SIGMA) < 0.001 "$name:0 vs $name:2 (SIGMA)"
+
+    # THETA is stored to only (360/65536) deg accuracy
+    if ("$name:0" == "PSF_THETA")
+      # echo $MEAN
+      tapOK {abs($MEAN)  < 0.006} "$name:0 vs $name:2 (MEAN = $MEAN)"
+      tapOK {abs($SIGMA) < 0.001} "$name:0 vs $name:2 (SIGMA = $SIGMA)"
+      continue
+    end
+
+    tapOK {abs($MEAN)  < 0.001} "$name:0 vs $name:2 (MEAN = $MEAN)"
+    tapOK {abs($SIGMA) < 0.001} "$name:0 vs $name:2 (SIGMA = $MEAN)"
+  end    
+
+  # exec rm test.cmf test.in.txt
+  # exec rm -r catdir.test
+
+  tapDONE
+end
+
+# make a simple input file for mkcmf
+macro mkinput
+  exec rm -f test.in.txt
+
+  output test.in.txt
+  for i 10 1024 100
+    for j 10 1024 100
+      fprintf " %4d %4d  %6.2f" $i $j {-15.0 + 2.5*($i + $j)/1000.0}
+    end
+  end
+  output stdout
+end
+
+# the following lists define fields in the cmf files which can be compared to their equivalents in DVO
+# the left column is the cmf field name, the right column is the dvo field name
+
+# list of cmf fields to test matched to mextract fields
+# this list is good for PS1_DEV_0
+list testfields_PS1_DEV_0
+  IPP_IDET          : detid
+  X_PSF             : xccd
+  Y_PSF             : yccd
+  X_PSF_SIG         : xccd:err
+  Y_PSF_SIG         : yccd:err
+  PSF_INST_MAG      : mag:inst
+  PSF_INST_MAG_SIG  : mag:err
+  PEAK_FLUX_AS_MAG  : SKIP # not ingested into DVO
+  SKY               : sky
+  SKY_SIG           : sky_err
+  PSF_CHISQ         : psf_chisq
+  PSF_WIDTH_X       : FWHM_MAJ
+  PSF_WIDTH_Y       : FWHM_MIN
+  PSF_THETA         : THETA
+  PSF_QF            : PSF_QF
+  N_FRAMES          : SKIP # not ingested into DVO
+end
+
+# list of cmf fields to test matched to mextract fields
+# this list is good for PS1_DEV_1
+list testfields_PS1_DEV_1
+  IPP_IDET          : detid
+  X_PSF             : xccd
+  Y_PSF             : yccd
+  X_PSF_SIG         : xccd:err
+  Y_PSF_SIG         : yccd:err
+  PSF_INST_MAG      : mag:inst
+  PSF_INST_MAG_SIG  : mag:err
+  PEAK_FLUX_AS_MAG  : SKIP # not ingested into DVO
+  SKY               : sky
+  SKY_SIG           : sky_err
+  PSF_CHISQ         : psf_chisq
+  CR_NSIGMA         : cr_nsigma
+  EXT_NSIGMA        : ext_nsigma
+  PSF_WIDTH_X       : FWHM_MAJ
+  PSF_WIDTH_Y       : FWHM_MIN
+  PSF_THETA         : THETA
+  PSF_QF            : PSF_QF
+  N_FRAMES          : SKIP # not ingested into DVO
+  FLAGS             : phot_flags
+end
+
+# this list is good for PS1_V1
+list testfields_PS1_V1
+  IPP_IDET          : detid     
+  X_PSF             : xccd      
+  Y_PSF             : yccd      
+  X_PSF_SIG         : xccd:err #  FAIL
+  Y_PSF_SIG         : yccd:err # FAIL
+  RA_PSF            : SKIP # astrometry is not calibrated in the cmf
+  DEC_PSF           : SKIP # astrometry is not calibrated in the cmf
+  POSANGLE          : SKIP # astrometry is not calibrated in the cmf
+  PLTSCALE          : SKIP # astrometry is not calibrated in the cmf
+  PSF_INST_MAG      : mag:inst  
+  PSF_INST_MAG_SIG  : mag:err   
+# AP_MAG_STANDARD   : mag:ap # FAIL
+  AP_MAG_RADIUS     : SKIP # no accessor
+  PEAK_FLUX_AS_MAG  : SKIP # no accessor
+  CAL_PSF_MAG       : SKIP # photometry is not calibrated in the cmf
+  CAL_PSF_MAG_SIG   : SKIP # photometry is not calibrated in the cmf
+  SKY               : sky       
+  SKY_SIGMA         : sky_err   
+  PSF_CHISQ         : psf_chisq 
+  CR_NSIGMA         : cr_nsigma 
+  EXT_NSIGMA        : ext_nsigma
+  PSF_MAJOR         : FWHM_MAJ  
+  PSF_MINOR         : FWHM_MIN  
+  PSF_THETA         : THETA # FAIL
+  PSF_QF            : PSF_QF    
+  PSF_NDOF          : SKIP # no accessor
+  PSF_NPIX          : SKIP # no accessor
+  MOMENTS_XX        : SKIP # no accessor
+  MOMENTS_XY        : SKIP # no accessor
+  MOMENTS_YY        : SKIP # no accessor
+  FLAGS             : phot_flags
+  N_FRAMES          : SKIP # no accessor        
+end
+
+# this list is good for PS1_V2
+list testfields_PS1_V2
+  IPP_IDET          : detid     
+  X_PSF             : xccd      
+  Y_PSF             : yccd      
+  X_PSF_SIG         : xccd:err # FAIL
+  Y_PSF_SIG         : yccd:err # FAIL
+  RA_PSF            : SKIP # astrometry is not calibrated in the cmf
+  DEC_PSF           : SKIP # astrometry is not calibrated in the cmf
+  POSANGLE          : SKIP # astrometry is not calibrated in the cmf
+  PLTSCALE          : SKIP # astrometry is not calibrated in the cmf
+  PSF_INST_MAG      : mag:inst  
+  PSF_INST_MAG_SIG  : mag:err   
+# AP_MAG_STANDARD   : mag:ap # FAIL
+  AP_MAG_RADIUS     : SKIP # no accessor
+  PEAK_FLUX_AS_MAG  : SKIP # no accessor
+  CAL_PSF_MAG       : SKIP # photometry is not calibrated in the cmf
+  CAL_PSF_MAG_SIG   : SKIP # photometry is not calibrated in the cmf
+  SKY               : sky       
+  SKY_SIGMA         : sky_err   
+  PSF_CHISQ         : psf_chisq 
+  CR_NSIGMA         : cr_nsigma 
+  EXT_NSIGMA        : ext_nsigma
+  PSF_MAJOR         : FWHM_MAJ  
+  PSF_MINOR         : FWHM_MIN  
+  PSF_THETA         : THETA # FAIL
+  PSF_QF            : PSF_QF    
+  PSF_NDOF          : SKIP # no accessor
+  PSF_NPIX          : SKIP # no accessor
+  MOMENTS_XX        : SKIP # no accessor
+  MOMENTS_XY        : SKIP # no accessor
+  MOMENTS_YY        : SKIP # no accessor
+  FLAGS             : phot_flags
+  N_FRAMES          : SKIP # no accessor        
+end
+
+# this list is good for PS1_V3
+list testfields_PS1_V3
+  IPP_IDET          : detid     
+  X_PSF             : xccd      
+  Y_PSF             : yccd      
+  X_PSF_SIG         : xccd:err # FAIL
+  Y_PSF_SIG         : yccd:err # FAIL
+  POSANGLE          : SKIP # astrometry is not calibrated in the cmf
+  PLTSCALE          : SKIP # astrometry is not calibrated in the cmf
+  PSF_INST_MAG      : mag:inst  
+  PSF_INST_MAG_SIG  : mag:err   
+  PSF_INST_FLUX     : SKIP # not ingested into DVO
+  PSF_INST_FLUX_SIG : SKIP # not ingested into DVO
+# AP_MAG_STANDARD   : mag:aperinst # FAIL
+  AP_MAG_RAW        : SKIP # not ingested into DVO
+  AP_MAG_RADIUS     : SKIP # not ingested into DVO
+  CAL_PSF_MAG       : SKIP # photometry is not calibrated in the cmf
+  CAL_PSF_MAG_SIG   : SKIP # photometry is not calibrated in the cmf
+  RA_PSF            : SKIP # astrometry is not calibrated in the cmf
+  DEC_PSF           : SKIP # astrometry is not calibrated in the cmf
+  PEAK_FLUX_AS_MAG  : SKIP # not ingested into DVO
+  SKY               : sky       
+  SKY_SIGMA         : sky_err   
+  PSF_CHISQ         : psf_chisq 
+  CR_NSIGMA         : cr_nsigma 
+  EXT_NSIGMA        : ext_nsigma
+  PSF_MAJOR         : FWHM_MAJ  
+  PSF_MINOR         : FWHM_MIN  
+  PSF_THETA         : THETA # FAIL
+  PSF_QF            : PSF_QF    
+  PSF_QF_PERFECT    : SKIP # not ingested into DVO
+  PSF_NDOF          : PSF_NDOF
+  PSF_NPIX          : PSF_NPIX
+  MOMENTS_XX        : MXX
+  MOMENTS_XY        : MXY
+  MOMENTS_YY        : MYY
+  MOMENTS_M3C       : SKIP # not ingested into DVO
+  MOMENTS_M3S       : SKIP # not ingested into DVO
+  MOMENTS_M4C       : SKIP # not ingested into DVO
+  MOMENTS_M4S       : SKIP # not ingested into DVO
+  MOMENTS_R1        : SKIP # not ingested into DVO
+  MOMENTS_RH        : SKIP # not ingested into DVO
+  KRON_FLUX         : mag:kron:inst
+  KRON_FLUX_ERR     : mag:kron:err
+  KRON_FLUX_INNER   : SKIP # not ingested into DVO
+  KRON_FLUX_OUTER   : SKIP # not ingested into DVO
+  FLAGS             : phot_flags
+  N_FRAMES          : SKIP # not ingested into DVO
+end
+
+# this list is good for PS1_V5
+list testfields_PS1_V5
+  IPP_IDET          : detid     
+  X_PSF             : xccd      
+  Y_PSF             : yccd      
+  X_PSF_SIG         : xccd:err
+  Y_PSF_SIG         : yccd:err
+  POSANGLE          : posangle
+  PLTSCALE          : platescale
+  PSF_INST_MAG      : mag:inst  
+  PSF_INST_MAG_SIG  : mag:err   
+  PSF_INST_FLUX     : flux:inst
+  PSF_INST_FLUX_SIG : flux:inst:err
+  AP_MAG            : mag:aper:inst
+  AP_MAG_RAW        : SKIP # not ingested into DVO
+  AP_MAG_RADIUS     : SKIP # not ingested into DVO
+  AP_FLUX           : flux:aper:inst  
+  AP_FLUX_SIG       : flux:aper:inst:err
+  CAL_PSF_MAG       : mag:cal
+  CAL_PSF_MAG_SIG   : mag:cal:err
+  RA_PSF            : ra
+  DEC_PSF           : dec
+  AP_NPIX           : SKIP # not ingested into DVO		      
+  PEAK_FLUX_AS_MAG  : SKIP # not ingested into DVO		      
+  SKY               : sky       				      
+  SKY_SIGMA         : sky_err   				      
+  PSF_CHISQ         : psf_chisq 				      
+  CR_NSIGMA         : cr_nsigma 				      
+  EXT_NSIGMA        : ext_nsigma				      
+  PSF_MAJOR         : fwhm_maj # XXX technically, this is not FWHM but Sigma
+  PSF_MINOR         : fwhm_min # XXX technically, this is not FWHM but Sigma
+  PSF_THETA         : theta # FAIL				      
+  PSF_CORE          : SKIP # not ingested into DVO 
+  PSF_FWHM_MAJ      : SKIP # not ingested into DVO 
+  PSF_FWHM_MIN      : SKIP # not ingested into DVO 
+  PSF_QF            : psf_qf    				      
+  PSF_QF_PERFECT    : SKIP # not ingested into DVO		      
+  PSF_NDOF          : psf_ndof				      
+  PSF_NPIX          : psf_npix				      
+  MOMENTS_XX        : Mxx					      
+  MOMENTS_XY        : Mxy					      
+  MOMENTS_YY        : Myy					      
+  MOMENTS_M3C       : SKIP # not ingested into DVO		      
+  MOMENTS_M3S       : SKIP # not ingested into DVO		      
+  MOMENTS_M4C       : SKIP # not ingested into DVO		      
+  MOMENTS_M4S       : SKIP # not ingested into DVO		      
+  MOMENTS_R1        : SKIP # not ingested into DVO		      
+  MOMENTS_RH        : SKIP # not ingested into DVO		      
+  KRON_FLUX         : flux:kron:inst				      
+  KRON_FLUX_ERR     : flux:kron:inst:err				      
+  KRON_FLUX_INNER   : SKIP # not ingested into DVO		          
+  KRON_FLUX_OUTER   : SKIP # not ingested into DVO		      
+  SKY_LIMIT_RAD     : SKIP # not ingested into DVO		          
+  SKY_LIMIT_FLUX    : SKIP # not ingested into DVO		          
+  SKY_LIMIT_SLOPE   : SKIP # not ingested into DVO		          
+  FLAGS             : phot_flags				      
+  FLAGS2            : SKIP # not ingested into DVO		          
+  N_FRAMES          : SKIP # not ingested into DVO		      
+end								      
+
+# this list is good for PS1_SV3
+list testfields_PS1_SV3
+  IPP_IDET          : detid     
+  X_PSF             : xccd      
+  Y_PSF             : yccd      
+  X_PSF_SIG         : xccd:err
+  Y_PSF_SIG         : yccd:err
+  POSANGLE          : posangle
+  PLTSCALE          : platescale
+  PSF_INST_MAG      : mag:inst  
+  PSF_INST_MAG_SIG  : mag:err   
+  PSF_INST_FLUX     : flux:inst
+  PSF_INST_FLUX_SIG : flux:inst:err
+  AP_MAG            : mag:aper:inst
+  AP_MAG_RAW        : SKIP # not ingested into DVO
+  AP_MAG_RADIUS     : SKIP # not ingested into DVO
+  AP_FLUX           : flux:aper:inst  
+  AP_FLUX_SIG       : flux:aper:inst:err
+  CAL_PSF_MAG       : mag:cal
+  CAL_PSF_MAG_SIG   : mag:cal:err
+  RA_PSF            : ra
+  DEC_PSF           : dec
+  AP_NPIX           : SKIP # not ingested into DVO		      
+  PEAK_FLUX_AS_MAG  : SKIP # not ingested into DVO		      
+  SKY               : sky       				      
+  SKY_SIGMA         : sky_err   				      
+  PSF_CHISQ         : psf_chisq 				      
+  CR_NSIGMA         : cr_nsigma 				      
+  EXT_NSIGMA        : ext_nsigma				      
+  PSF_MAJOR         : fwhm_maj # XXX technically, this is not FWHM but Sigma
+  PSF_MINOR         : fwhm_min # XXX technically, this is not FWHM but Sigma
+  PSF_THETA         : theta # FAIL				      
+  PSF_CORE          : SKIP # not ingested into DVO 
+  PSF_FWHM_MAJ      : SKIP # not ingested into DVO 
+  PSF_FWHM_MIN      : SKIP # not ingested into DVO 
+  PSF_QF            : psf_qf    				      
+  PSF_QF_PERFECT    : SKIP # not ingested into DVO		      
+  PSF_NDOF          : psf_ndof				      
+  PSF_NPIX          : psf_npix				      
+  MOMENTS_XX        : Mxx					      
+  MOMENTS_XY        : Mxy					      
+  MOMENTS_YY        : Myy					      
+  MOMENTS_M3C       : SKIP # not ingested into DVO		      
+  MOMENTS_M3S       : SKIP # not ingested into DVO		      
+  MOMENTS_M4C       : SKIP # not ingested into DVO		      
+  MOMENTS_M4S       : SKIP # not ingested into DVO		      
+  MOMENTS_R1        : SKIP # not ingested into DVO		      
+  MOMENTS_RH        : SKIP # not ingested into DVO		      
+  KRON_FLUX         : flux:kron:inst				      
+  KRON_FLUX_ERR     : flux:kron:inst:err				      
+  KRON_FLUX_INNER   : SKIP # not ingested into DVO		          
+  KRON_FLUX_OUTER   : SKIP # not ingested into DVO		      
+  FLAGS             : phot_flags				      
+  FLAGS2            : SKIP # not ingested into DVO		          
+  N_FRAMES          : SKIP # not ingested into DVO		      
+end								      
Index: /branches/eam_branches/ipp-20150419/Ohana/src/addstar/test/simple.dvo
===================================================================
--- /branches/eam_branches/ipp-20150419/Ohana/src/addstar/test/simple.dvo	(revision 38443)
+++ /branches/eam_branches/ipp-20150419/Ohana/src/addstar/test/simple.dvo	(revision 38444)
@@ -10,5 +10,5 @@
   test.fields PS1_V2    PS1_V1
   test.fields PS1_V3    PS1_V1
-  test.fields PS1_V4    PS1_V1
+  test.fields PS1_V5    PS1_V1
 
   test.fields PS1_DEV_0 PS1_V2
@@ -17,5 +17,5 @@
   test.fields PS1_V2    PS1_V2
   test.fields PS1_V3    PS1_V2
-  test.fields PS1_V4    PS1_V4
+  test.fields PS1_V5    PS1_V2
 
   test.fields PS1_DEV_0 PS1_V3
@@ -24,5 +24,5 @@
   test.fields PS1_V2    PS1_V3
   test.fields PS1_V3    PS1_V3
-  test.fields PS1_V4    PS1_V4
+  test.fields PS1_V5    PS1_V3
 
   test.fields PS1_DEV_0 PS1_V4
@@ -31,5 +31,5 @@
   test.fields PS1_V2    PS1_V4
   test.fields PS1_V3    PS1_V4
-  test.fields PS1_V4    PS1_V4
+  test.fields PS1_V5    PS1_V4
 end  
 
@@ -54,13 +54,6 @@
 
   mkinput
-  echo mkcmf test.in.txt test.cmf -date 2008/1/1 -time 01:00:00 -radec $RA $DEC -type $1 $NO_NOISE
-  exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time 01:00:00 -radec $RA $DEC -type $1 $NO_NOISE
-  if ($TAP_VERBOSE)
-    echo exec addstar -D CATDIR catdir.test -D CAMERA simtest test.cmf -D CATFORMAT $2 -quick-airmass
-    exec addstar -D CATDIR catdir.test -D CAMERA simtest test.cmf -D CATFORMAT $2 -quick-airmass
-  else
-    echo addstar -D CATDIR catdir.test -D CAMERA simtest test.cmf -D CATFORMAT $2 -quick-airmass
-    exec addstar -D CATDIR catdir.test -D CAMERA simtest test.cmf -D CATFORMAT $2 -quick-airmass >& tmp.log
-  end
+  tapEXEC mkcmf test.in.txt test.cmf -date 2008/1/1 -time 01:00:00 -radec $RA $DEC -type $1 $NO_NOISE
+  tapEXEC addstar -D CATDIR catdir.test -D CAMERA simtest test.cmf -D CATFORMAT $2 -quick-airmass
 
   list testfields -copy testfields_$1
@@ -79,4 +72,5 @@
     if ("$name:0" == "SKIP") continue
     if ("$name:2" == "SKIP") continue
+ 
     read -fits Chip.psf $name:0
     mextract $name:2
@@ -92,6 +86,6 @@
   set d = $name:0 - $name:2
   vstat -q d
-  tapOK {abs($MEAN)  < 0.001} "$name:0 vs $name:2 (MEAN)"
-  tapOK {abs($SIGMA) < 0.001} "$name:0 vs $name:2 (SIGMA)"
+  tapOK {abs($MEAN)  < 0.001} "$name:0 vs $name:2 (MEAN = $MEAN)"
+  tapOK {abs($SIGMA) < 0.001} "$name:0 vs $name:2 (SIGMA = $SIGMA)"
 
   # detection ID must be first for this to work:
@@ -142,11 +136,11 @@
     if ("$name:0" == "PSF_THETA")
       # echo $MEAN
-      tapOK {abs($MEAN)  < 0.006} "$name:0 vs $name:2 (MEAN)"
-      tapOK {abs($SIGMA) < 0.001} "$name:0 vs $name:2 (SIGMA)"
+      tapOK {abs($MEAN)  < 0.006} "$name:0 vs $name:2 (MEAN = $MEAN)"
+      tapOK {abs($SIGMA) < 0.001} "$name:0 vs $name:2 (SIGMA = $SIGMA)"
       continue
     end
 
-    tapOK {abs($MEAN)  < 0.001} "$name:0 vs $name:2 (MEAN)"
-    tapOK {abs($SIGMA) < 0.001} "$name:0 vs $name:2 (SIGMA)"
+    tapOK {abs($MEAN)  < 0.001} "$name:0 vs $name:2 (MEAN = $MEAN)"
+    tapOK {abs($SIGMA) < 0.001} "$name:0 vs $name:2 (SIGMA = $MEAN)"
   end    
 
@@ -231,5 +225,5 @@
   PSF_INST_MAG      : mag:inst  
   PSF_INST_MAG_SIG  : mag:err   
-  AP_MAG_STANDARD   : mag:ap # FAIL
+# AP_MAG_STANDARD   : mag:ap # FAIL
   AP_MAG_RADIUS     : SKIP # no accessor
   PEAK_FLUX_AS_MAG  : SKIP # no accessor
@@ -237,5 +231,5 @@
   CAL_PSF_MAG_SIG   : SKIP # photometry is not calibrated in the cmf
   SKY               : sky       
-  SKY_SIG           : sky_err   
+  SKY_SIGMA         : sky_err   
   PSF_CHISQ         : psf_chisq 
   CR_NSIGMA         : cr_nsigma 
@@ -267,5 +261,5 @@
   PSF_INST_MAG      : mag:inst  
   PSF_INST_MAG_SIG  : mag:err   
-  AP_MAG_STANDARD   : mag:ap # FAIL
+# AP_MAG_STANDARD   : mag:ap # FAIL
   AP_MAG_RADIUS     : SKIP # no accessor
   PEAK_FLUX_AS_MAG  : SKIP # no accessor
@@ -273,5 +267,5 @@
   CAL_PSF_MAG_SIG   : SKIP # photometry is not calibrated in the cmf
   SKY               : sky       
-  SKY_SIG           : sky_err   
+  SKY_SIGMA         : sky_err   
   PSF_CHISQ         : psf_chisq 
   CR_NSIGMA         : cr_nsigma 
@@ -303,5 +297,5 @@
   PSF_INST_FLUX     : SKIP # not ingested into DVO
   PSF_INST_FLUX_SIG : SKIP # not ingested into DVO
-  AP_MAG_STANDARD   : mag:aperinst # FAIL
+# AP_MAG_STANDARD   : mag:aperinst # FAIL
   AP_MAG_RAW        : SKIP # not ingested into DVO
   AP_MAG_RADIUS     : SKIP # not ingested into DVO
@@ -312,5 +306,5 @@
   PEAK_FLUX_AS_MAG  : SKIP # not ingested into DVO
   SKY               : sky       
-  SKY_SIG           : sky_err   
+  SKY_SIGMA         : sky_err   
   PSF_CHISQ         : psf_chisq 
   CR_NSIGMA         : cr_nsigma 
@@ -332,6 +326,6 @@
   MOMENTS_R1        : SKIP # not ingested into DVO
   MOMENTS_RH        : SKIP # not ingested into DVO
-  KRON_FLUX         : mag:kroninst
-  KRON_FLUX_ERR     : mag:kronerr
+  KRON_FLUX         : mag:kron:inst
+  KRON_FLUX_ERR     : mag:kron:err
   KRON_FLUX_INNER   : SKIP # not ingested into DVO
   KRON_FLUX_OUTER   : SKIP # not ingested into DVO
