Index: trunk/Ohana/src/addstar/src/SEDfit.c
===================================================================
--- trunk/Ohana/src/addstar/src/SEDfit.c	(revision 15514)
+++ trunk/Ohana/src/addstar/src/SEDfit.c	(revision 15743)
@@ -210,6 +210,7 @@
     }
   }
-  outcat[0].Naverage = Nave;
-  outcat[0].Nmeasure = Nmeas;
+  outcat[0].Naverage  = Nave;
+  outcat[0].Nmeasure  = Nmeas;
+  outcat[0].Nsecf_mem = Nave*Nsec;
   
   free (sourceValue.mags);
Index: trunk/Ohana/src/addstar/src/UpdateDatabase_Image.c
===================================================================
--- trunk/Ohana/src/addstar/src/UpdateDatabase_Image.c	(revision 15514)
+++ trunk/Ohana/src/addstar/src/UpdateDatabase_Image.c	(revision 15743)
@@ -13,5 +13,5 @@
 
   catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
-  if (options[0].update) catalog.catflags = LOAD_AVES | LOAD_MEAS_META | LOAD_MISS | LOAD_SECF;
+  if (options[0].update) catalog.catflags = LOAD_AVES | LOAD_MISS | LOAD_SECF;
   
   // XXX this is probably not needed anymore
@@ -49,5 +49,5 @@
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
     catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
-    if (options[0].update) catalog.catflags = LOAD_AVES | LOAD_MEAS_META | LOAD_MISS | LOAD_SECF;
+    if (options[0].update) catalog.catflags = LOAD_AVES | LOAD_MISS | LOAD_SECF;
 
     // an error exit status here is a significant error
@@ -57,7 +57,7 @@
     }
 
-    // Nave_disk == 0 implies an empty catalog file
+    // Naves_disk == 0 implies an empty catalog file
     // for only_match, skip empty catalogs 
-    if ((catalog.Nave_disk == 0) && options[0].only_match) {
+    if ((catalog.Naves_disk == 0) && options[0].only_match) {
       dvo_catalog_unlock (&catalog);
       dvo_catalog_free (&catalog);
@@ -73,5 +73,10 @@
     if (!options[0].only_images) {
       SetProtect (TRUE);
-      dvo_catalog_save (&catalog, VERBOSE);
+      if (options[0].update) {
+	catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
+	dvo_catalog_update (&catalog, VERBOSE);
+      } else {
+	dvo_catalog_save (&catalog, VERBOSE);
+      }
       SetProtect (FALSE);
     }
Index: trunk/Ohana/src/addstar/src/UpdateDatabase_Refcat.c
===================================================================
--- trunk/Ohana/src/addstar/src/UpdateDatabase_Refcat.c	(revision 15514)
+++ trunk/Ohana/src/addstar/src/UpdateDatabase_Refcat.c	(revision 15743)
@@ -37,5 +37,5 @@
     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_MEAS_META | LOAD_MISS | LOAD_SECF;
+    if (options[0].update) catalog.catflags = LOAD_AVES | LOAD_MISS | LOAD_SECF;
   
     // an error exit status here is a significant error
@@ -45,7 +45,7 @@
     }
 
-    // Nave_disk == 0 implies an empty catalog file
+    // Naves_disk == 0 implies an empty catalog file
     // for only_match, skip empty catalogs
-    if ((catalog.Nave_disk == 0) && options[0].only_match) {
+    if ((catalog.Naves_disk == 0) && options[0].only_match) {
       dvo_catalog_unlock (&catalog);
       dvo_catalog_free (&catalog);
@@ -62,5 +62,10 @@
     if (!options[0].only_images) {
       SetProtect (TRUE);
-      dvo_catalog_save (&catalog, VERBOSE);
+      if (options[0].update) {
+	catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
+	dvo_catalog_update (&catalog, VERBOSE);
+      } else {
+	dvo_catalog_save (&catalog, VERBOSE);
+      }
       SetProtect (FALSE);
     }
Index: trunk/Ohana/src/addstar/src/UpdateDatabase_Reflist.c
===================================================================
--- trunk/Ohana/src/addstar/src/UpdateDatabase_Reflist.c	(revision 15514)
+++ trunk/Ohana/src/addstar/src/UpdateDatabase_Reflist.c	(revision 15743)
@@ -37,5 +37,5 @@
     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_MEAS_META | LOAD_MISS | LOAD_SECF;
+    if (options[0].update) catalog.catflags = LOAD_AVES | LOAD_MISS | LOAD_SECF;
 
     // 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.Nave_disk == 0) && options[0].only_match) {
+    if ((catalog.Naves_disk == 0) && options[0].only_match) {
       dvo_catalog_unlock (&catalog);
       dvo_catalog_free (&catalog);
@@ -58,5 +58,10 @@
     if (!options[0].only_images) {
       SetProtect (TRUE);
-      dvo_catalog_save (&catalog, VERBOSE);
+      if (options[0].update) {
+	catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
+	dvo_catalog_update (&catalog, VERBOSE);
+      } else {
+	dvo_catalog_save (&catalog, VERBOSE);
+      }
       SetProtect (FALSE);
     }
Index: trunk/Ohana/src/addstar/src/addstar.c
===================================================================
--- trunk/Ohana/src/addstar/src/addstar.c	(revision 15514)
+++ trunk/Ohana/src/addstar/src/addstar.c	(revision 15743)
@@ -90,5 +90,5 @@
     catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
-    if (options.update) catalog.catflags = LOAD_AVES | LOAD_MEAS_META | LOAD_MISS | LOAD_SECF;
+    if (options.update) catalog.catflags = LOAD_AVES | LOAD_MISS | LOAD_SECF;
 
     // open as read or write, depending on desire
@@ -105,7 +105,7 @@
     }
 
-    // Nave_disk == 0 implies an empty catalog file
+    // Naves_disk == 0 implies an empty catalog file
     // for only_match, skip empty catalogs
-    if ((catalog.Nave_disk == 0) && options.only_match) {
+    if ((catalog.Naves_disk == 0) && options.only_match) {
       dvo_catalog_unlock (&catalog);
       dvo_catalog_free (&catalog);
@@ -142,5 +142,10 @@
     if (Nsubset && !options.only_images) {
       SetProtect (TRUE);
-      dvo_catalog_save (&catalog, VERBOSE);
+      if (options.update) {
+	catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
+	dvo_catalog_update (&catalog, VERBOSE);
+      } else {
+	dvo_catalog_save (&catalog, VERBOSE);
+      }
       SetProtect (FALSE);
     }
Index: trunk/Ohana/src/addstar/src/find_matches.c
===================================================================
--- trunk/Ohana/src/addstar/src/find_matches.c	(revision 15514)
+++ trunk/Ohana/src/addstar/src/find_matches.c	(revision 15743)
@@ -361,4 +361,5 @@
   catalog[0].Naverage = Nave;
   catalog[0].Nmeasure = Nmeas;
+  catalog[0].Nsecf_mem = Nave*Nsecfilt;
   if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas: %d %d %d, (%d matches)\n", Nstars, Nave, Nmeas, Nmatch);
 
Index: trunk/Ohana/src/addstar/src/find_matches_closest.c
===================================================================
--- trunk/Ohana/src/addstar/src/find_matches_closest.c	(revision 15514)
+++ trunk/Ohana/src/addstar/src/find_matches_closest.c	(revision 15743)
@@ -362,4 +362,5 @@
   catalog[0].Naverage = Nave;
   catalog[0].Nmeasure = Nmeas;
+  catalog[0].Nsecf_mem = Nave*Nsecfilt;
   if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas: %d %d %d, (%d matches)\n", Nstars, Nave, Nmeas, Nmatch);
 
Index: trunk/Ohana/src/addstar/src/find_matches_refstars.c
===================================================================
--- trunk/Ohana/src/addstar/src/find_matches_refstars.c	(revision 15514)
+++ trunk/Ohana/src/addstar/src/find_matches_refstars.c	(revision 15743)
@@ -372,4 +372,5 @@
   catalog[0].Nmeasure = Nmeas;
   catalog[0].Nmissing = Nmiss;
+  catalog[0].Nsecf_mem = Nave*Nsecfilt;
   if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas, Nmiss: %d %d %d %d, (%d matches)\n", Nstars, Nave, Nmeas, Nmiss, Nmatch);
   return (Nmatch);
Index: trunk/Ohana/src/addstar/src/load2mass_catalog.c
===================================================================
--- trunk/Ohana/src/addstar/src/load2mass_catalog.c	(revision 15514)
+++ trunk/Ohana/src/addstar/src/load2mass_catalog.c	(revision 15743)
@@ -79,4 +79,5 @@
   catalog[0].Naverage = Nave;
   catalog[0].Nmeasure = Nmeas;
+  catalog[0].Nsecf_mem = Nave*Nsec;
   return (TRUE);
 }
Index: trunk/Ohana/src/addstar/src/sedstar.c
===================================================================
--- trunk/Ohana/src/addstar/src/sedstar.c	(revision 15514)
+++ trunk/Ohana/src/addstar/src/sedstar.c	(revision 15743)
@@ -34,6 +34,6 @@
     }
 
-    // Nave_disk == 0 implies an empty catalog file
-    if ((incatalog.Nave_disk == 0) && options.only_match) {
+    // Naves_disk == 0 implies an empty catalog file
+    if ((incatalog.Naves_disk == 0) && options.only_match) {
       if (VERBOSE) fprintf (stderr, "skipping empty region\n");
       dvo_catalog_unlock (&incatalog);
