IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38372


Ignore:
Timestamp:
Jun 5, 2015, 8:22:24 AM (11 years ago)
Author:
eugene
Message:

adding CATCOMPRESS to dvo config options; cleaning up command strextend stuff

Location:
branches/eam_branches/ohana.20150429/src
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20150429/src/addstar/src/resort_threaded.c

    r38352 r38372  
    4343
    4444    // set the parameters which guide catalog open/load/create
    45     catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
    46     catalog.catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
    47     catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_LENSING;
    48     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
     45    catalog.catformat   = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
     46    catalog.catmode     = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
     47    catalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
     48    catalog.catflags    = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_LENSING;
     49    catalog.Nsecfilt    = GetPhotcodeNsecfilt ();
    4950 
    5051    // an error exit status here is a significant error (disk I/O or file access)
  • branches/eam_branches/ohana.20150429/src/addstar/src/resort_unthreaded.c

    r38352 r38372  
    2121
    2222    // set the parameters which guide catalog open/load/create
    23     catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
    24     catalog.catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
    25     catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_LENSING;
    26     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
     23    catalog.catformat   = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
     24    catalog.catmode     = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
     25    catalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
     26    catalog.catflags    = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_LENSING;
     27    catalog.Nsecfilt    = GetPhotcodeNsecfilt ();
    2728
    2829    // an error exit status here is a significant error (disk I/O or file access)
  • branches/eam_branches/ohana.20150429/src/libfits/include/gfitsio.h

    r38366 r38372  
    139139int     gfits_modify                   PROTO((Header *header, char *field, char *mode, int N,...)) OHANA_FORMAT(printf, 3, 5);
    140140int     gfits_print                    PROTO((Header *header, char *field, char *mode, int N,...)) OHANA_FORMAT(printf, 3, 5);
    141 int     gfits_modify_alt               PROTO((Header *header, char *field, char *mode, int N,...));
    142 int     gfits_print_alt                PROTO((Header *header, char *field, char *mode, int N,...));
     141int     gfits_modify_alt               PROTO((Header *header, char *field, char *mode, int N,...)); // do not use a FORMAT: non-standard fmt chars
     142int     gfits_print_alt                PROTO((Header *header, char *field, char *mode, int N,...)); // do not use a FORMAT: non-standard fmt chars
    143143int     gfits_find_Xheader             PROTO((FILE *f, Header *header, char *extname));
    144144int     gfits_read_Xheader             PROTO((char *filename, Header *header, int N));
     
    146146int     gfits_save_header              PROTO((FILE *f, Header *header));
    147147int     gfits_scan                     PROTO((Header *header, char *field, char *mode, int N,...)) OHANA_FORMAT(scanf, 3, 5);
    148 int     gfits_scan_alt                 PROTO((Header *header, char *field, char *mode, int N,...));
     148int     gfits_scan_alt                 PROTO((Header *header, char *field, char *mode, int N,...)); // do not use a FORMAT: non-standard fmt chars
    149149int     gfits_set_unsign_mode          PROTO((int mode));
    150150int     gfits_stripwhite               PROTO((char *string));
  • branches/eam_branches/ohana.20150429/src/libohana/include/ohana.h

    r37807 r38372  
    286286char   *strcreate              PROTO((char *string));
    287287char   *strncreate             PROTO((char *string, int n));
     288int     strextend              PROTO((char *input, char *format,...)) OHANA_FORMAT(printf, 2, 3);
    288289int     scan_line              PROTO((FILE *f, char *line));
    289290int     scan_line_maxlen       PROTO((FILE *f, char *line, int maxlen));
     
    393394
    394395char   *memstr                 PROTO((char *m1, char *m2, int n));
    395 int     write_fmt              PROTO((int fd, char *format, ...));
     396int     write_fmt              PROTO((int fd, char *format, ...)) OHANA_FORMAT(printf, 2, 3);
    396397
    397398char   **isolate_elements      PROTO((int argc, char **argv, int *nstack));
     
    403404
    404405// gprint gets a stub implementation in libohana. opihi implements the real one.
    405 int    gprint (gpDest dest, char *format, ...);
     406int    gprint                  PROTO((gpDest dest, char *format, ...) OHANA_FORMAT(printf, 2, 3));
    406407
    407408// rconnect is used to run remote programs with a pipe for communication
  • branches/eam_branches/ohana.20150429/src/libohana/src/string.c

    r37033 r38372  
    5151}
    5252
     53int strextend (char *input, char *format,...) {
     54
     55  char tmpextra[1024], tmpline[1024];
     56  va_list argp;
     57
     58  va_start (argp, format);
     59  vsnprintf (tmpextra, 1024, format, argp);
     60  snprintf (tmpline, 1024, "%s %s", input, tmpextra);
     61  strcpy (input, tmpline);
     62
     63  return TRUE;
     64}
     65
    5366/* create a new string of length n from this string */
    5467char *strncreate (char *string, int n) {
  • branches/eam_branches/ohana.20150429/src/photdbc/include/photdbc.h

    r37807 r38372  
    5454char  *CATMODE;    /* raw, mef, split, mysql */
    5555char  *CATFORMAT;  /* internal, elixir, loneos, panstarrs */
     56char  *CATCOMPRESS;  /* ?? */
    5657char   PhotCodeFile[DVO_MAX_PATH];
    5758
  • branches/eam_branches/ohana.20150429/src/photdbc/src/ConfigInit.c

    r34749 r38372  
    6363  WarnConfig (config, "ZERO_PT",                "%lf", 0, &ZERO_POINT);
    6464
     65  // NOTE: in this program, CATFORMAT, CATMODE, CATCOMPRESS may only be set
     66  // as command-line options, eg: -set-format PS1_V5
     67
    6568  if (!success) {
    6669    fprintf (stderr, "missing config parameter\n");
  • branches/eam_branches/ohana.20150429/src/photdbc/src/args.c

    r37807 r38372  
    7171    remove_argument (N, &argc, argv);
    7272    CATMODE = strcreate (argv[N]);
     73    remove_argument (N, &argc, argv);
     74  }
     75
     76  // override input catalog format (PS1_V1, PS1_REF, etc)
     77  CATCOMPRESS = NULL;
     78  if ((N = get_argument (argc, argv, "-set-compress"))) {
     79    remove_argument (N, &argc, argv);
     80    CATCOMPRESS = strcreate (argv[N]);
    7381    remove_argument (N, &argc, argv);
    7482  }
     
    257265  }
    258266
     267  // override input catalog format (PS1_V1, PS1_REF, etc)
     268  CATCOMPRESS = NULL;
     269  if ((N = get_argument (argc, argv, "-set-compress"))) {
     270    remove_argument (N, &argc, argv);
     271    CATCOMPRESS = strcreate (argv[N]);
     272    remove_argument (N, &argc, argv);
     273  }
     274
    259275  /* specify portion of the sky */
    260276  REGION.Rmin = 0;
  • branches/eam_branches/ohana.20150429/src/photdbc/src/photdbc_catalogs.c

    r38352 r38372  
    5151
    5252    // define outcatalog open parameters
    53     outcatalog.catformat = CATFORMAT ? dvo_catalog_catformat (CATFORMAT) : incatalog.catformat;
    54     outcatalog.catmode   = CATMODE   ? dvo_catalog_catmode (CATMODE)     : incatalog.catmode;
    55     outcatalog.Nsecfilt  = incatalog.Nsecfilt;                 // inherit from the incatalog
    56     outcatalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
     53    outcatalog.catformat   = CATFORMAT   ? dvo_catalog_catformat   (CATFORMAT)   : incatalog.catformat;
     54    outcatalog.catmode     = CATMODE     ? dvo_catalog_catmode     (CATMODE)     : incatalog.catmode;
     55    outcatalog.catcompress = CATCOMPRESS ? dvo_catalog_catcompress (CATCOMPRESS) : incatalog.catcompress; // set the default catcompress from config data
     56    outcatalog.Nsecfilt    = incatalog.Nsecfilt;                 // inherit from the incatalog
     57    outcatalog.catflags    = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
    5758
    5859    // output catalogs always represent the same skyregions as the input catalogs
     
    135136    if (PHOTCODE_DROP_LIST) { snprintf (tmpline, DVO_MAX_PATH, "%s -photcode-drop %s", command, PHOTCODE_DROP_LIST);    strcpy (command, tmpline); }
    136137    if (PHOTCODE_KEEP_LIST) { snprintf (tmpline, DVO_MAX_PATH, "%s -photcode-keep %s", command, PHOTCODE_KEEP_LIST);    strcpy (command, tmpline); }
     138    if (CATCOMPRESS)        { snprintf (tmpline, DVO_MAX_PATH, "%s -set-compress %s",  command, CATCOMPRESS);                   strcpy (command, tmpline); }
    137139    if (CATFORMAT)          { snprintf (tmpline, DVO_MAX_PATH, "%s -set-format %s",    command, CATFORMAT);                     strcpy (command, tmpline); }
    138140    if (CATMODE)            { snprintf (tmpline, DVO_MAX_PATH, "%s -set-mode %s",      command, CATMODE);                       strcpy (command, tmpline); }
  • branches/eam_branches/ohana.20150429/src/relphot/include/relphot.h

    r38062 r38372  
    494494
    495495int launch_region_hosts (RegionHostTable *regionHosts);
    496 int strextend (char *input, char *format,...);
    497496
    498497Image *ImageTableLoad(char *filename, off_t *nimage);
  • branches/eam_branches/ohana.20150429/src/relphot/src/launch_region_hosts.c

    r37037 r38372  
    11# include "relphot.h"
    22# define DEBUG 0
    3 
    4 int strextend (char *input, char *format,...) {
    5 
    6   char tmpextra[1024], tmpline[1024];
    7   va_list argp;
    8 
    9   va_start (argp, format);
    10   vsnprintf (tmpextra, 1024, format, argp);
    11   snprintf (tmpline, 1024, "%s %s", input, tmpextra);
    12   strcpy (input, tmpline);
    13 
    14   return TRUE;
    15 }
    163
    174int launch_region_hosts (RegionHostTable *regionHosts) {
  • branches/eam_branches/ohana.20150429/src/relphot/src/load_catalogs.c

    r38352 r38372  
    4141    char hostfile[1024];
    4242    snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name);
    43     tcatalog.filename = hostID ? hostfile : skylist[0].filename[i];
    44 
    45     tcatalog.catformat = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
    46     tcatalog.catmode   = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
    47     tcatalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;    // don't need to load all data at this point
    48     tcatalog.Nsecfilt  = GetPhotcodeNsecfilt ();               // set the desired number in case we need to create the catalog
     43    tcatalog.filename    = hostID ? hostfile : skylist[0].filename[i];
     44    tcatalog.catformat   = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
     45    tcatalog.catmode     = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
     46    tcatalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
     47    tcatalog.catflags    = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;    // don't need to load all data at this point
     48    tcatalog.Nsecfilt    = GetPhotcodeNsecfilt ();               // set the desired number in case we need to create the catalog
    4949
    5050    if (!dvo_catalog_open (&tcatalog, skylist[0].regions[i], VERBOSE2, "r")) {
  • branches/eam_branches/ohana.20150429/src/relphot/src/reload_catalogs.c

    r38352 r38372  
    5656    TIMESTAMP(time1);
    5757
    58     catalog.catformat = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
    59     catalog.catmode   = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
    60     catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
    61     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();               // set the desired number in case we need to create the catalog
     58    catalog.catformat   = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
     59    catalog.catmode     = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
     60    catalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
     61    catalog.catflags    = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
     62    catalog.Nsecfilt    = GetPhotcodeNsecfilt ();               // set the desired number in case we need to create the catalog
    6263
    6364    if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "w")) {
  • branches/eam_branches/ohana.20150429/src/relphot/src/relphot_objects.c

    r38352 r38372  
    3939    char hostfile[1024];
    4040    snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name);
    41     catalog.filename  = hostID ? hostfile : skylist[0].filename[i];
    42     catalog.catformat = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
    43     catalog.catmode   = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
    44     catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
    45     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
     41    catalog.filename    = hostID ? hostfile : skylist[0].filename[i];
     42    catalog.catformat   = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
     43    catalog.catmode     = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
     44    catalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
     45    catalog.catflags    = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
     46    catalog.Nsecfilt    = GetPhotcodeNsecfilt ();
    4647
    4748    if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "w")) {
  • branches/eam_branches/ohana.20150429/src/relphot/src/relphot_synthphot.c

    r38352 r38372  
    4040    char hostfile[1024];
    4141    snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name);
    42     catalog.filename  = hostID ? hostfile : skylist[0].filename[i];
    43     catalog.catformat = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
    44     catalog.catmode   = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
    45     catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
    46     catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
     42    catalog.filename    = hostID ? hostfile : skylist[0].filename[i];
     43    catalog.catformat   = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
     44    catalog.catmode     = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
     45    catalog.catcompress = dvo_catalog_catcompress (CATCOMPRESS); // set the default catcompress from config data
     46    catalog.catflags    = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT;
     47    catalog.Nsecfilt    = GetPhotcodeNsecfilt ();
    4748
    4849    if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "w")) {
Note: See TracChangeset for help on using the changeset viewer.