Index: /branches/eam_branches/ohana.20150429/src/addstar/src/resort_threaded.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/addstar/src/resort_threaded.c	(revision 38371)
+++ /branches/eam_branches/ohana.20150429/src/addstar/src/resort_threaded.c	(revision 38372)
@@ -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  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_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)
Index: /branches/eam_branches/ohana.20150429/src/addstar/src/resort_unthreaded.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/addstar/src/resort_unthreaded.c	(revision 38371)
+++ /branches/eam_branches/ohana.20150429/src/addstar/src/resort_unthreaded.c	(revision 38372)
@@ -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  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_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)
Index: /branches/eam_branches/ohana.20150429/src/libfits/include/gfitsio.h
===================================================================
--- /branches/eam_branches/ohana.20150429/src/libfits/include/gfitsio.h	(revision 38371)
+++ /branches/eam_branches/ohana.20150429/src/libfits/include/gfitsio.h	(revision 38372)
@@ -139,6 +139,6 @@
 int     gfits_modify                   PROTO((Header *header, char *field, char *mode, int N,...)) OHANA_FORMAT(printf, 3, 5); 
 int     gfits_print                    PROTO((Header *header, char *field, char *mode, int N,...)) OHANA_FORMAT(printf, 3, 5); 
-int     gfits_modify_alt               PROTO((Header *header, char *field, char *mode, int N,...)); 
-int     gfits_print_alt                PROTO((Header *header, char *field, char *mode, int N,...)); 
+int     gfits_modify_alt               PROTO((Header *header, char *field, char *mode, int N,...)); // do not use a FORMAT: non-standard fmt chars
+int     gfits_print_alt                PROTO((Header *header, char *field, char *mode, int N,...)); // do not use a FORMAT: non-standard fmt chars
 int     gfits_find_Xheader             PROTO((FILE *f, Header *header, char *extname));
 int     gfits_read_Xheader             PROTO((char *filename, Header *header, int N));
@@ -146,5 +146,5 @@
 int     gfits_save_header              PROTO((FILE *f, Header *header));
 int     gfits_scan                     PROTO((Header *header, char *field, char *mode, int N,...)) OHANA_FORMAT(scanf, 3, 5);
-int     gfits_scan_alt                 PROTO((Header *header, char *field, char *mode, int N,...));
+int     gfits_scan_alt                 PROTO((Header *header, char *field, char *mode, int N,...)); // do not use a FORMAT: non-standard fmt chars
 int     gfits_set_unsign_mode          PROTO((int mode));
 int     gfits_stripwhite               PROTO((char *string));
Index: /branches/eam_branches/ohana.20150429/src/libohana/include/ohana.h
===================================================================
--- /branches/eam_branches/ohana.20150429/src/libohana/include/ohana.h	(revision 38371)
+++ /branches/eam_branches/ohana.20150429/src/libohana/include/ohana.h	(revision 38372)
@@ -286,4 +286,5 @@
 char   *strcreate              PROTO((char *string));
 char   *strncreate             PROTO((char *string, int n));
+int     strextend              PROTO((char *input, char *format,...)) OHANA_FORMAT(printf, 2, 3);
 int     scan_line              PROTO((FILE *f, char *line)); 
 int     scan_line_maxlen       PROTO((FILE *f, char *line, int maxlen)); 
@@ -393,5 +394,5 @@
 
 char   *memstr                 PROTO((char *m1, char *m2, int n));
-int     write_fmt              PROTO((int fd, char *format, ...));
+int     write_fmt              PROTO((int fd, char *format, ...)) OHANA_FORMAT(printf, 2, 3);
 
 char   **isolate_elements      PROTO((int argc, char **argv, int *nstack));
@@ -403,5 +404,5 @@
 
 // gprint gets a stub implementation in libohana. opihi implements the real one.
-int    gprint (gpDest dest, char *format, ...);
+int    gprint                  PROTO((gpDest dest, char *format, ...) OHANA_FORMAT(printf, 2, 3));
 
 // rconnect is used to run remote programs with a pipe for communication
Index: /branches/eam_branches/ohana.20150429/src/libohana/src/string.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/libohana/src/string.c	(revision 38371)
+++ /branches/eam_branches/ohana.20150429/src/libohana/src/string.c	(revision 38372)
@@ -51,4 +51,17 @@
 }
 
+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;
+}
+
 /* create a new string of length n from this string */
 char *strncreate (char *string, int n) {
Index: /branches/eam_branches/ohana.20150429/src/photdbc/include/photdbc.h
===================================================================
--- /branches/eam_branches/ohana.20150429/src/photdbc/include/photdbc.h	(revision 38371)
+++ /branches/eam_branches/ohana.20150429/src/photdbc/include/photdbc.h	(revision 38372)
@@ -54,4 +54,5 @@
 char  *CATMODE;    /* raw, mef, split, mysql */
 char  *CATFORMAT;  /* internal, elixir, loneos, panstarrs */
+char  *CATCOMPRESS;  /* ?? */
 char   PhotCodeFile[DVO_MAX_PATH];
 
Index: /branches/eam_branches/ohana.20150429/src/photdbc/src/ConfigInit.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/photdbc/src/ConfigInit.c	(revision 38371)
+++ /branches/eam_branches/ohana.20150429/src/photdbc/src/ConfigInit.c	(revision 38372)
@@ -63,4 +63,7 @@
   WarnConfig (config, "ZERO_PT",                "%lf", 0, &ZERO_POINT);
 
+  // NOTE: in this program, CATFORMAT, CATMODE, CATCOMPRESS may only be set 
+  // as command-line options, eg: -set-format PS1_V5
+
   if (!success) { 
     fprintf (stderr, "missing config parameter\n");
Index: /branches/eam_branches/ohana.20150429/src/photdbc/src/args.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/photdbc/src/args.c	(revision 38371)
+++ /branches/eam_branches/ohana.20150429/src/photdbc/src/args.c	(revision 38372)
@@ -71,4 +71,12 @@
     remove_argument (N, &argc, argv);
     CATMODE = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  // override input catalog format (PS1_V1, PS1_REF, etc)
+  CATCOMPRESS = NULL;
+  if ((N = get_argument (argc, argv, "-set-compress"))) {
+    remove_argument (N, &argc, argv);
+    CATCOMPRESS = strcreate (argv[N]);
     remove_argument (N, &argc, argv);
   }
@@ -257,4 +265,12 @@
   }
 
+  // override input catalog format (PS1_V1, PS1_REF, etc)
+  CATCOMPRESS = NULL;
+  if ((N = get_argument (argc, argv, "-set-compress"))) {
+    remove_argument (N, &argc, argv);
+    CATCOMPRESS = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
   /* specify portion of the sky */
   REGION.Rmin = 0;
Index: /branches/eam_branches/ohana.20150429/src/photdbc/src/photdbc_catalogs.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/photdbc/src/photdbc_catalogs.c	(revision 38371)
+++ /branches/eam_branches/ohana.20150429/src/photdbc/src/photdbc_catalogs.c	(revision 38372)
@@ -51,8 +51,9 @@
 
     // define outcatalog open parameters
-    outcatalog.catformat = CATFORMAT ? dvo_catalog_catformat (CATFORMAT) : incatalog.catformat;
-    outcatalog.catmode   = CATMODE   ? dvo_catalog_catmode (CATMODE)     : incatalog.catmode;
-    outcatalog.Nsecfilt  = incatalog.Nsecfilt;                 // inherit from the incatalog
-    outcatalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
+    outcatalog.catformat   = CATFORMAT   ? dvo_catalog_catformat   (CATFORMAT)   : incatalog.catformat;
+    outcatalog.catmode     = CATMODE     ? dvo_catalog_catmode     (CATMODE)     : incatalog.catmode;
+    outcatalog.catcompress = CATCOMPRESS ? dvo_catalog_catcompress (CATCOMPRESS) : incatalog.catcompress; // set the default catcompress from config data
+    outcatalog.Nsecfilt    = incatalog.Nsecfilt;                 // inherit from the incatalog
+    outcatalog.catflags    = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
 
     // output catalogs always represent the same skyregions as the input catalogs
@@ -135,4 +136,5 @@
     if (PHOTCODE_DROP_LIST) { snprintf (tmpline, DVO_MAX_PATH, "%s -photcode-drop %s", command, PHOTCODE_DROP_LIST); 	strcpy (command, tmpline); }
     if (PHOTCODE_KEEP_LIST) { snprintf (tmpline, DVO_MAX_PATH, "%s -photcode-keep %s", command, PHOTCODE_KEEP_LIST); 	strcpy (command, tmpline); }
+    if (CATCOMPRESS)        { snprintf (tmpline, DVO_MAX_PATH, "%s -set-compress %s",  command, CATCOMPRESS); 	                strcpy (command, tmpline); }
     if (CATFORMAT)          { snprintf (tmpline, DVO_MAX_PATH, "%s -set-format %s",    command, CATFORMAT); 	                strcpy (command, tmpline); }
     if (CATMODE)            { snprintf (tmpline, DVO_MAX_PATH, "%s -set-mode %s",      command, CATMODE);        	        strcpy (command, tmpline); }
Index: /branches/eam_branches/ohana.20150429/src/relphot/include/relphot.h
===================================================================
--- /branches/eam_branches/ohana.20150429/src/relphot/include/relphot.h	(revision 38371)
+++ /branches/eam_branches/ohana.20150429/src/relphot/include/relphot.h	(revision 38372)
@@ -494,5 +494,4 @@
 
 int launch_region_hosts (RegionHostTable *regionHosts);
-int strextend (char *input, char *format,...);
 
 Image *ImageTableLoad(char *filename, off_t *nimage);
Index: /branches/eam_branches/ohana.20150429/src/relphot/src/launch_region_hosts.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/relphot/src/launch_region_hosts.c	(revision 38371)
+++ /branches/eam_branches/ohana.20150429/src/relphot/src/launch_region_hosts.c	(revision 38372)
@@ -1,17 +1,4 @@
 # include "relphot.h"
 # define DEBUG 0
-
-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 launch_region_hosts (RegionHostTable *regionHosts) {
Index: /branches/eam_branches/ohana.20150429/src/relphot/src/load_catalogs.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/relphot/src/load_catalogs.c	(revision 38371)
+++ /branches/eam_branches/ohana.20150429/src/relphot/src/load_catalogs.c	(revision 38372)
@@ -41,10 +41,10 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name);
-    tcatalog.filename = hostID ? hostfile : skylist[0].filename[i];
-
-    tcatalog.catformat = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
-    tcatalog.catmode   = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
-    tcatalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;    // don't need to load all data at this point
-    tcatalog.Nsecfilt  = GetPhotcodeNsecfilt ();               // set the desired number in case we need to create the catalog
+    tcatalog.filename    = hostID ? hostfile : skylist[0].filename[i];
+    tcatalog.catformat   = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
+    tcatalog.catmode     = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
+    tcatalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
+    tcatalog.catflags    = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;    // don't need to load all data at this point
+    tcatalog.Nsecfilt    = GetPhotcodeNsecfilt ();               // set the desired number in case we need to create the catalog
 
     if (!dvo_catalog_open (&tcatalog, skylist[0].regions[i], VERBOSE2, "r")) {
Index: /branches/eam_branches/ohana.20150429/src/relphot/src/reload_catalogs.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/relphot/src/reload_catalogs.c	(revision 38371)
+++ /branches/eam_branches/ohana.20150429/src/relphot/src/reload_catalogs.c	(revision 38372)
@@ -56,8 +56,9 @@
     TIMESTAMP(time1);
 
-    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  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
-    catalog.Nsecfilt  = GetPhotcodeNsecfilt ();               // set the desired number in case we need to create the catalog
+    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_MISSING | DVO_LOAD_SECFILT;
+    catalog.Nsecfilt    = GetPhotcodeNsecfilt ();               // set the desired number in case we need to create the catalog
 
     if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "w")) {
Index: /branches/eam_branches/ohana.20150429/src/relphot/src/relphot_objects.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/relphot/src/relphot_objects.c	(revision 38371)
+++ /branches/eam_branches/ohana.20150429/src/relphot/src/relphot_objects.c	(revision 38372)
@@ -39,9 +39,10 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name);
-    catalog.filename  = hostID ? hostfile : 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  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
-    catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
+    catalog.filename    = hostID ? hostfile : 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.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;
+    catalog.Nsecfilt    = GetPhotcodeNsecfilt ();
 
     if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "w")) {
Index: /branches/eam_branches/ohana.20150429/src/relphot/src/relphot_synthphot.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/relphot/src/relphot_synthphot.c	(revision 38371)
+++ /branches/eam_branches/ohana.20150429/src/relphot/src/relphot_synthphot.c	(revision 38372)
@@ -40,9 +40,10 @@
     char hostfile[1024];
     snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name);
-    catalog.filename  = hostID ? hostfile : 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  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
-    catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
+    catalog.filename    = hostID ? hostfile : 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.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
+    catalog.catflags    = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
+    catalog.Nsecfilt    = GetPhotcodeNsecfilt ();
 
     if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "w")) {
