IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38391


Ignore:
Timestamp:
Jun 5, 2015, 12:44:29 PM (11 years ago)
Author:
eugene
Message:

update to libohana strextend

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

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20150429/Makefile.Common

    r38337 r38391  
    4444        @echo ""
    4545
    46 $(TEST)/%.$(ARCH): $(TEST)/%.c
    47         echo $@
    48         echo $*
    49         echo $<
    50         echo $^
    51         @if [ ! -d $(TEST) ]; then mkdir -p $(TEST); fi
     46$(TESTDIR)/%.$(ARCH): $(TESTDIR)/%.c
     47        @echo $@
     48        @echo $*
     49        @echo $<
     50        @echo $^
     51        @if [ ! -d $(TESTDIR) ]; then mkdir -p $(TESTDIR); fi
    5252        $(CC) $(TEST_CFLAGS) -o $@ $^ $(TEST_LDFLAGS)
    5353        @echo "compiled $*"
    5454        @echo ""
    5555
    56 $(TESTBIN)/%: $(TEST)/%.$(ARCH)
     56$(TESTBIN)/%: $(TESTDIR)/%.$(ARCH)
    5757        @if [ ! -d $(TESTBIN) ]; then mkdir -p $(TESTBIN); fi
    5858        rm -f $(TESTBIN)/$*
    59         cp $(TEST)/$*.$(ARCH) $(TESTBIN)/$*
     59        cp $(TESTDIR)/$*.$(ARCH) $(TESTBIN)/$*
    6060        @echo "installed $*"
    6161        @echo ""
     
    128128        rm -f `find . -name "#*"`
    129129
     130test.clean:
     131        for i in $(TESTPROG); do rm -f $(TESTBIN)/$$i; done
     132        for i in $(TESTPROG); do rm -f $(TESTDIR)/$$i.$(ARCH); done
     133
    130134dist: clean
    131135        rm -rf $(BIN)
  • branches/eam_branches/ohana.20150429/src/dvopsps/src/insert_detections_dvopsps.c

    r38352 r38391  
    138138    }
    139139
    140     char command[1024];
    141     snprintf (command, 1024, "dvopsps_client detections -hostID %d -catdir %s -hostdir %s -region %f %f %f %f",
     140    char *command = NULL;
     141    strextend (&command, "dvopsps_client detections -hostID %d -catdir %s -hostdir %s -region %f %f %f %f",
    142142              table->hosts[i].hostID, CATDIR, table->hosts[i].pathname,
    143143              UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
    144144
    145     char tmpline[1024];
    146     snprintf (tmpline, 1024, "%s -dbhost %s", command, DATABASE_HOST); strcpy (command, tmpline);
    147     snprintf (tmpline, 1024, "%s -dbuser %s", command, DATABASE_USER); strcpy (command, tmpline);
    148     snprintf (tmpline, 1024, "%s -dbpass %s", command, DATABASE_PASS); strcpy (command, tmpline);
    149     snprintf (tmpline, 1024, "%s -dbname %s", command, DATABASE_NAME); strcpy (command, tmpline);
    150 
    151     if (VERBOSE)     { snprintf (tmpline, 1024, "%s -v",       command);                          strcpy (command, tmpline); }
    152     if (SAVE_REMOTE) { snprintf (tmpline, 1024, "%s -save %s", command, table->hosts[i].results); strcpy (command, tmpline); }
     145    strextend (&command, "-dbhost %s", DATABASE_HOST);
     146    strextend (&command, "-dbuser %s", DATABASE_USER);
     147    strextend (&command, "-dbpass %s", DATABASE_PASS);
     148    strextend (&command, "-dbname %s", DATABASE_NAME);
     149
     150    if (VERBOSE)     { strextend (&command, "-v");}
     151    if (SAVE_REMOTE) { strextend (&command, "-save %s", table->hosts[i].results);}
    153152
    154153    // some filters -- these are the detections we skip
    155     if (TIME_START) { snprintf (tmpline, 1024, "%s -time-start %s", command, TIME_START); strcpy (command, tmpline); }
    156     if (TIME_END)   { snprintf (tmpline, 1024, "%s -time-end %s",   command, TIME_END);   strcpy (command, tmpline); }
     154    if (TIME_START) { strextend (&command, "-time-start %s", TIME_START);}
     155    if (TIME_END)   { strextend (&command, "-time-end %s", TIME_END);}
    157156   
    158     if (PHOTCODE_START > 0)      { snprintf (tmpline, 1024, "%s -photcode-start %d", command, PHOTCODE_START); strcpy (command, tmpline); }
    159     if (PHOTCODE_END <= INT_MAX) { snprintf (tmpline, 1024, "%s -photcode-end %d",   command, PHOTCODE_END);   strcpy (command, tmpline); }
     157    if (PHOTCODE_START > 0)      { strextend (&command, "-photcode-start %d", PHOTCODE_START);}
     158    if (PHOTCODE_END <= INT_MAX) { strextend (&command, "-photcode-end %d", PHOTCODE_END);}
    160159
    161160    fprintf (stderr, "command: %s\n", command);
  • branches/eam_branches/ohana.20150429/src/dvopsps/src/insert_diffobj_dvopsps.c

    r38352 r38391  
    126126    table->hosts[i].pathname = tmppath;
    127127
    128     char command[1024];
    129     snprintf (command, 1024, "dvopsps_client diffobj -hostID %d -catdir %s -hostdir %s -region %f %f %f %f",
     128    char *command = NULL;
     129    strextend (&command, "dvopsps_client diffobj -hostID %d -catdir %s -hostdir %s -region %f %f %f %f",
    130130              table->hosts[i].hostID, CATDIR, table->hosts[i].pathname,
    131131              UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
    132132
    133     char tmpline[1024];
    134     snprintf (tmpline, 1024, "%s -dbhost %s", command, DATABASE_HOST); strcpy (command, tmpline);
    135     snprintf (tmpline, 1024, "%s -dbuser %s", command, DATABASE_USER); strcpy (command, tmpline);
    136     snprintf (tmpline, 1024, "%s -dbpass %s", command, DATABASE_PASS); strcpy (command, tmpline);
    137     snprintf (tmpline, 1024, "%s -dbname %s", command, DATABASE_NAME); strcpy (command, tmpline);
     133    strextend (&command, "-dbhost %s", DATABASE_HOST);
     134    strextend (&command, "-dbuser %s", DATABASE_USER);
     135    strextend (&command, "-dbpass %s", DATABASE_PASS);
     136    strextend (&command, "-dbname %s", DATABASE_NAME);
    138137
    139     if (VERBOSE)    { snprintf (tmpline, 1024, "%s -v",      command);             strcpy (command, tmpline); }
    140     if (SINGLE_CPT) { snprintf (tmpline, 1024, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); }
     138    if (VERBOSE)    { strextend (&command, "-v"); }
     139    if (SINGLE_CPT) { strextend (&command, "-cpt %s", SINGLE_CPT); }
    141140
    142141    fprintf (stderr, "command: %s\n", command);
  • branches/eam_branches/ohana.20150429/src/dvopsps/src/insert_objects_dvopsps.c

    r38352 r38391  
    126126    table->hosts[i].pathname = tmppath;
    127127
    128     char command[1024];
    129     snprintf (command, 1024, "dvopsps_client objects -hostID %d -catdir %s -hostdir %s -region %f %f %f %f",
     128    char *command = NULL;
     129    strextend (&command, "dvopsps_client objects -hostID %d -catdir %s -hostdir %s -region %f %f %f %f",
    130130              table->hosts[i].hostID, CATDIR, table->hosts[i].pathname,
    131131              UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
    132132
    133     char tmpline[1024];
    134     snprintf (tmpline, 1024, "%s -dbhost %s", command, DATABASE_HOST); strcpy (command, tmpline);
    135     snprintf (tmpline, 1024, "%s -dbuser %s", command, DATABASE_USER); strcpy (command, tmpline);
    136     snprintf (tmpline, 1024, "%s -dbpass %s", command, DATABASE_PASS); strcpy (command, tmpline);
    137     snprintf (tmpline, 1024, "%s -dbname %s", command, DATABASE_NAME); strcpy (command, tmpline);
     133    strextend (&command, "-dbhost %s", DATABASE_HOST);
     134    strextend (&command, "-dbuser %s", DATABASE_USER);
     135    strextend (&command, "-dbpass %s", DATABASE_PASS);
     136    strextend (&command, "-dbname %s", DATABASE_NAME);
    138137
    139     if (VERBOSE)    { snprintf (tmpline, 1024, "%s -v",      command);             strcpy (command, tmpline); }
    140     if (SINGLE_CPT) { snprintf (tmpline, 1024, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); }
     138    if (VERBOSE)    { strextend (&command, "-v"); }
     139    if (SINGLE_CPT) { strextend (&command, "-cpt %s", SINGLE_CPT); }
    141140
    142141    fprintf (stderr, "command: %s\n", command);
  • branches/eam_branches/ohana.20150429/src/photdbc/src/photdbc_catalogs.c

    r38372 r38391  
    122122
    123123    // options / arguments that can affect relastro_client -update-objects:
    124     char command[DVO_MAX_PATH];
    125     snprintf (command, DVO_MAX_PATH, "photdbc_client %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -D NMEAS_MIN %d -D NMEAS_MIN_FILTERED %d -D AVE_SIGMA_LIM %f -D SIGMA_MAX %f",
     124    char *command = NULL;
     125    strextend (&command, "photdbc_client %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -D NMEAS_MIN %d -D NMEAS_MIN_FILTERED %d -D AVE_SIGMA_LIM %f -D SIGMA_MAX %f",
    126126              tmproot, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname,
    127127              REGION.Rmin, REGION.Rmax, REGION.Dmin, REGION.Dmax,
     
    129129      );
    130130
    131     char tmpline[DVO_MAX_PATH];
    132     if (VERBOSE)            { snprintf (tmpline, DVO_MAX_PATH, "%s -v",                command);                             strcpy (command, tmpline); }
    133     if (ExcludeByInstMag)   { snprintf (tmpline, DVO_MAX_PATH, "%s -instmag %f %f",    command, INST_MAG_MIN, INST_MAG_MAX); strcpy (command, tmpline); }
    134     if (ExcludeByMinSigma)  { snprintf (tmpline, DVO_MAX_PATH, "%s -min-sigma %f",     command, SIGMA_MIN_KEEP);                strcpy (command, tmpline); }
    135     if (ExcludeByMaxMinMag) { snprintf (tmpline, DVO_MAX_PATH, "%s -maxminmag %f",     command, MAX_MIN_MAG);                   strcpy (command, tmpline); }
    136     if (PHOTCODE_DROP_LIST) { snprintf (tmpline, DVO_MAX_PATH, "%s -photcode-drop %s", command, PHOTCODE_DROP_LIST);    strcpy (command, tmpline); }
    137     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); }
    139     if (CATFORMAT)          { snprintf (tmpline, DVO_MAX_PATH, "%s -set-format %s",    command, CATFORMAT);                     strcpy (command, tmpline); }
    140     if (CATMODE)            { snprintf (tmpline, DVO_MAX_PATH, "%s -set-mode %s",      command, CATMODE);                       strcpy (command, tmpline); }
     131    if (VERBOSE)            { strextend (&command, "-v"); }
     132    if (ExcludeByInstMag)   { strextend (&command, "-instmag %f %f", INST_MAG_MIN, INST_MAG_MAX); }
     133    if (ExcludeByMinSigma)  { strextend (&command, "-min-sigma %f", SIGMA_MIN_KEEP); }
     134    if (ExcludeByMaxMinMag) { strextend (&command, "-maxminmag %f", MAX_MIN_MAG); }
     135    if (PHOTCODE_DROP_LIST) { strextend (&command, "-photcode-drop %s", PHOTCODE_DROP_LIST); }
     136    if (PHOTCODE_KEEP_LIST) { strextend (&command, "-photcode-keep %s", PHOTCODE_KEEP_LIST); }
     137    if (CATCOMPRESS)        { strextend (&command, "-set-compress %s", CATCOMPRESS); }
     138    if (CATFORMAT)          { strextend (&command, "-set-format %s", CATFORMAT); }
     139    if (CATMODE)            { strextend (&command, "-set-mode %s", CATMODE); }
    141140
    142141    if (PARALLEL_OUTHOSTS) {
     
    144143      free  (table_output->hosts[i].pathname);
    145144      table_output->hosts[i].pathname = tmppath;
    146       snprintf (tmpline, DVO_MAX_PATH, "%s -hostdir-output %s", command, table_output->hosts[i].pathname); strcpy (command, tmpline);
     145      strextend (&command, "-hostdir-output %s", table_output->hosts[i].pathname);
    147146    }
    148147
  • branches/eam_branches/ohana.20150429/src/relastro/src/high_speed_catalogs.c

    r38352 r38391  
    147147    }
    148148
    149     char command[1024];
    150     snprintf (command, 1024, "relastro_client -high-speed %s %s %f %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f",
     149    char *command = NULL;
     150    strextend (&command, "relastro_client -high-speed %s %s %f %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f",
    151151              PHOTCODE_A_LIST, PHOTCODE_B_LIST, RADIUS, outputDir, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
    152152
     
    154154
    155155    // options / arguments that can affect relastro_client -high-speed
    156     char tmpline[1024];
    157     if (FIT_MODE == FIT_PM_ONLY)         { snprintf (tmpline, 1024, "%s -pm",    command);              strcpy (command, tmpline); }
    158     if (FIT_MODE == FIT_PAR_ONLY)        { snprintf (tmpline, 1024, "%s -par",   command);              strcpy (command, tmpline); }
    159     if (FIT_MODE == FIT_PM_AND_PAR)      { snprintf (tmpline, 1024, "%s -pmpar", command);              strcpy (command, tmpline); }
    160 
    161     if (VERBOSE)       { snprintf (tmpline, 1024, "%s -v",              command);                       strcpy (command, tmpline); }
    162     if (VERBOSE2)      { snprintf (tmpline, 1024, "%s -vv",             command);                       strcpy (command, tmpline); }
    163     if (RESET)         { snprintf (tmpline, 1024, "%s -reset",          command);                       strcpy (command, tmpline); }
    164     if (ImagSelect)    { snprintf (tmpline, 1024, "%s -instmag %f %f",  command, ImagMin, ImagMax);     strcpy (command, tmpline); }
    165     if (MaxDensityUse) { snprintf (tmpline, 1024, "%s -max-density %f", command, MaxDensityValue);      strcpy (command, tmpline); }
     156    if (FIT_MODE == FIT_PM_ONLY)         { strextend (&command, "-pm"); }
     157    if (FIT_MODE == FIT_PAR_ONLY)        { strextend (&command, "-par"); }
     158    if (FIT_MODE == FIT_PM_AND_PAR)      { strextend (&command, "-pmpar"); }
     159
     160    if (VERBOSE)       { strextend (&command, "-v"); }
     161    if (VERBOSE2)      { strextend (&command, "-vv"); }
     162    if (RESET)         { strextend (&command, "-reset"); }
     163    if (ImagSelect)    { strextend (&command, "-instmag %f %f", ImagMin, ImagMax); }
     164    if (MaxDensityUse) { strextend (&command, "-max-density %f", MaxDensityValue); }
    166165   
    167     if (USE_BASIC_CHECK) { snprintf (tmpline, 1024, "%s -basic-image-search", command);                 strcpy (command, tmpline); }
    168 
    169     if (FlagOutlier)   { snprintf (tmpline, 1024, "%s -clip %d",        command, CLIP_THRESH);          strcpy (command, tmpline); }
    170    
    171     if (USE_FIXED_PIXCOORDS) { snprintf (tmpline, 1024, "%s -D USE_FIXED_PIXCOORDS 1", command);     strcpy (command, tmpline); }
    172 
    173     if (PHOTCODE_KEEP_LIST) { snprintf (tmpline, 1024, "%s +photcode %s", command, PHOTCODE_KEEP_LIST); strcpy (command, tmpline); }
    174     if (PHOTCODE_SKIP_LIST) { snprintf (tmpline, 1024, "%s -photcode %s", command, PHOTCODE_SKIP_LIST); strcpy (command, tmpline); }
    175     if (PhotFlagSelect)    { snprintf (tmpline, 1024, "%s +photflags",   command);                      strcpy (command, tmpline); }
    176     if (PhotFlagBad)       { snprintf (tmpline, 1024, "%s +photflagbad %d", command, PhotFlagBad);      strcpy (command, tmpline); }
    177     if (PhotFlagPoor)      { snprintf (tmpline, 1024, "%s +photflagpoor %d", command, PhotFlagPoor);    strcpy (command, tmpline); }
     166    if (USE_BASIC_CHECK)     { strextend (&command, "-basic-image-search"); }
     167    if (FlagOutlier)         { strextend (&command, "-clip %d", CLIP_THRESH); }
     168    if (USE_FIXED_PIXCOORDS) { strextend (&command, "-D USE_FIXED_PIXCOORDS 1"); }
     169    if (PHOTCODE_KEEP_LIST)  { strextend (&command, "+photcode %s", PHOTCODE_KEEP_LIST); }
     170    if (PHOTCODE_SKIP_LIST)  { strextend (&command, "-photcode %s", PHOTCODE_SKIP_LIST); }
     171    if (PhotFlagSelect)      { strextend (&command, "+photflags"); }
     172    if (PhotFlagBad)         { strextend (&command, "+photflagbad %d", PhotFlagBad); }
     173    if (PhotFlagPoor)        { strextend (&command, "+photflagpoor %d", PhotFlagPoor); }
    178174    // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values
    179175
    180     if (MinBadQF > 0.0)    { snprintf (tmpline, 1024, "%s -min-bad-psfqf %f",        command, MinBadQF);      strcpy (command, tmpline); }
    181     if (MaxMeanOffset != 10.0) { snprintf (tmpline, 1024, "%s -max-mean-offset  %f", command, MaxMeanOffset); strcpy (command, tmpline); }
    182 
    183     if (WHERE_A[0]) { snprintf (tmpline, 1024, "%s -D WHERE_A \"%s\"", command, WHERE_A);               strcpy (command, tmpline); }
    184     if (WHERE_B[0]) { snprintf (tmpline, 1024, "%s -D WHERE_B \"%s\"", command, WHERE_B);               strcpy (command, tmpline); }
     176    if (MinBadQF > 0.0)        { strextend (&command, "-min-bad-psfqf %f", MinBadQF); }
     177    if (MaxMeanOffset != 10.0) { strextend (&command, "-max-mean-offset  %f", MaxMeanOffset); }
     178
     179    if (WHERE_A[0]) { strextend (&command, "-D WHERE_A \"%s\"", WHERE_A); }
     180    if (WHERE_B[0]) { strextend (&command, "-D WHERE_B \"%s\"", WHERE_B); }
    185181
    186182    if (TimeSelect) {
    187183      char *tstart = ohana_sec_to_date (TSTART);
    188184      char *tstop  = ohana_sec_to_date (TSTOP);
    189       snprintf (tmpline, 1024, "%s -time %s %s", command, tstart, tstop);
     185      strextend (&command, "-time %s %s", tstart, tstop);
    190186      free (tstart);
    191187      free (tstop);
    192       strcpy (command, tmpline);
    193188    }
    194189
  • branches/eam_branches/ohana.20150429/src/relastro/src/hpm_catalogs.c

    r38352 r38391  
    145145    }
    146146
    147     char command[1024];
    148     snprintf (command, 1024, "relastro_client -hpm %f %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f",
     147    char *command = NULL;
     148    strextend (&command, "relastro_client -hpm %f %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f",
    149149              RADIUS, outputDir, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
    150150
     
    152152
    153153    // options / arguments that can affect relastro_client -high-speed
    154     char tmpline[1024];
    155     if (FIT_MODE == FIT_PM_ONLY)         { snprintf (tmpline, 1024, "%s -pm",    command);              strcpy (command, tmpline); }
    156     if (FIT_MODE == FIT_PAR_ONLY)        { snprintf (tmpline, 1024, "%s -par",   command);              strcpy (command, tmpline); }
    157     if (FIT_MODE == FIT_PM_AND_PAR)      { snprintf (tmpline, 1024, "%s -pmpar", command);              strcpy (command, tmpline); }
    158 
    159     if (VERBOSE)       { snprintf (tmpline, 1024, "%s -v",              command);                       strcpy (command, tmpline); }
    160     if (VERBOSE2)      { snprintf (tmpline, 1024, "%s -vv",             command);                       strcpy (command, tmpline); }
    161     if (RESET)         { snprintf (tmpline, 1024, "%s -reset",          command);                       strcpy (command, tmpline); }
    162     if (ImagSelect)    { snprintf (tmpline, 1024, "%s -instmag %f %f",  command, ImagMin, ImagMax);     strcpy (command, tmpline); }
    163     if (MaxDensityUse) { snprintf (tmpline, 1024, "%s -max-density %f", command, MaxDensityValue);      strcpy (command, tmpline); }
     154    if (FIT_MODE == FIT_PM_ONLY)         { strextend (&command, "-pm"); }
     155    if (FIT_MODE == FIT_PAR_ONLY)        { strextend (&command, "-par"); }
     156    if (FIT_MODE == FIT_PM_AND_PAR)      { strextend (&command, "-pmpar"); }
     157
     158    if (VERBOSE)       { strextend (&command, "-v"); }
     159    if (VERBOSE2)      { strextend (&command, "-vv"); }
     160    if (RESET)         { strextend (&command, "-reset"); }
     161    if (ImagSelect)    { strextend (&command, "-instmag %f %f", ImagMin, ImagMax); }
     162    if (MaxDensityUse) { strextend (&command, "-max-density %f", MaxDensityValue); }
    164163   
    165     if (USE_BASIC_CHECK) { snprintf (tmpline, 1024, "%s -basic-image-search", command);                 strcpy (command, tmpline); }
    166 
    167     if (FlagOutlier)   { snprintf (tmpline, 1024, "%s -clip %d",        command, CLIP_THRESH);          strcpy (command, tmpline); }
    168    
    169     if (USE_FIXED_PIXCOORDS) { snprintf (tmpline, 1024, "%s -D USE_FIXED_PIXCOORDS 1", command);     strcpy (command, tmpline); }
    170 
    171     if (PHOTCODE_KEEP_LIST) { snprintf (tmpline, 1024, "%s +photcode %s", command, PHOTCODE_KEEP_LIST); strcpy (command, tmpline); }
    172     if (PHOTCODE_SKIP_LIST) { snprintf (tmpline, 1024, "%s -photcode %s", command, PHOTCODE_SKIP_LIST); strcpy (command, tmpline); }
    173     if (PhotFlagSelect)    { snprintf (tmpline, 1024, "%s +photflags",   command);                      strcpy (command, tmpline); }
    174     if (PhotFlagBad)       { snprintf (tmpline, 1024, "%s +photflagbad %d", command, PhotFlagBad);      strcpy (command, tmpline); }
    175     if (PhotFlagPoor)      { snprintf (tmpline, 1024, "%s +photflagpoor %d", command, PhotFlagPoor);    strcpy (command, tmpline); }
     164    if (USE_BASIC_CHECK)     { strextend (&command, "-basic-image-search"); }
     165    if (FlagOutlier)         { strextend (&command, "-clip %d", CLIP_THRESH); }
     166    if (USE_FIXED_PIXCOORDS) { strextend (&command, "-D USE_FIXED_PIXCOORDS 1"); }
     167    if (PHOTCODE_KEEP_LIST)  { strextend (&command, "+photcode %s", PHOTCODE_KEEP_LIST); }
     168    if (PHOTCODE_SKIP_LIST)  { strextend (&command, "-photcode %s", PHOTCODE_SKIP_LIST); }
     169    if (PhotFlagSelect)      { strextend (&command, "+photflags"); }
     170    if (PhotFlagBad)         { strextend (&command, "+photflagbad %d", PhotFlagBad); }
     171    if (PhotFlagPoor)        { strextend (&command, "+photflagpoor %d", PhotFlagPoor); }
    176172    // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values
    177173
    178     if (MinBadQF > 0.0)    { snprintf (tmpline, 1024, "%s -min-bad-psfqf %f",        command, MinBadQF);      strcpy (command, tmpline); }
    179     if (MaxMeanOffset != 10.0) { snprintf (tmpline, 1024, "%s -max-mean-offset  %f", command, MaxMeanOffset); strcpy (command, tmpline); }
     174    if (MinBadQF > 0.0)        { strextend (&command, "-min-bad-psfqf %f", MinBadQF); }
     175    if (MaxMeanOffset != 10.0) { strextend (&command, "-max-mean-offset  %f", MaxMeanOffset); }
    180176
    181177    if (TimeSelect) {
    182178      char *tstart = ohana_sec_to_date (TSTART);
    183179      char *tstop  = ohana_sec_to_date (TSTOP);
    184       snprintf (tmpline, 1024, "%s -time %s %s", command, tstart, tstop);
     180      strextend (&command, "-time %s %s", tstart, tstop);
    185181      free (tstart);
    186182      free (tstop);
    187       strcpy (command, tmpline);
    188183    }
    189184
  • branches/eam_branches/ohana.20150429/src/relastro/src/relastro_objects.c

    r38352 r38391  
    147147    // SRC_MEAS_TOOFEW
    148148
    149     char command[1024];
    150     snprintf (command, 1024, "relastro_client -update-objects -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s",
     149    char *command = NULL;
     150    strextend (&command, "relastro_client -update-objects -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s",
    151151              table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, STATMODE);
    152152
    153     char tmpline[1024];
    154     if (FIT_MODE == FIT_PM_ONLY)         { snprintf (tmpline, 1024, "%s -pm",    command);           strcpy (command, tmpline); }
    155     if (FIT_MODE == FIT_PAR_ONLY)        { snprintf (tmpline, 1024, "%s -par",   command);           strcpy (command, tmpline); }
    156     if (FIT_MODE == FIT_PM_AND_PAR)      { snprintf (tmpline, 1024, "%s -pmpar", command);           strcpy (command, tmpline); }
    157 
    158     if (VERBOSE)       { snprintf (tmpline, 1024, "%s -v",              command);                    strcpy (command, tmpline); }
    159     if (VERBOSE2)      { snprintf (tmpline, 1024, "%s -vv",             command);                    strcpy (command, tmpline); }
    160     if (RESET)         { snprintf (tmpline, 1024, "%s -reset",          command);                    strcpy (command, tmpline); }
    161     if (UPDATE)        { snprintf (tmpline, 1024, "%s -update",         command);                    strcpy (command, tmpline); }
    162 
    163     if (ImagSelect)    { snprintf (tmpline, 1024, "%s -instmag %f %f",  command, ImagMin, ImagMax);  strcpy (command, tmpline); }
    164     if (MaxDensityUse) { snprintf (tmpline, 1024, "%s -max-density %f", command, MaxDensityValue);   strcpy (command, tmpline); }
    165    
    166     if (FlagOutlier)   { snprintf (tmpline, 1024, "%s -clip %d",        command, CLIP_THRESH);       strcpy (command, tmpline); }
    167    
    168     if (USE_FIXED_PIXCOORDS) { snprintf (tmpline, 1024, "%s -D USE_FIXED_PIXCOORDS 1", command);     strcpy (command, tmpline); }
    169 
    170     if (PHOTCODE_KEEP_LIST) { snprintf (tmpline, 1024, "%s +photcode %s", command, PHOTCODE_KEEP_LIST); strcpy (command, tmpline); }
    171     if (PHOTCODE_SKIP_LIST) { snprintf (tmpline, 1024, "%s -photcode %s", command, PHOTCODE_SKIP_LIST); strcpy (command, tmpline); }
    172     if (PhotFlagSelect)    { snprintf (tmpline, 1024, "%s +photflags",   command);                      strcpy (command, tmpline); }
    173     if (PhotFlagBad)       { snprintf (tmpline, 1024, "%s +photflagbad %d", command, PhotFlagBad);      strcpy (command, tmpline); }
    174     if (PhotFlagPoor)      { snprintf (tmpline, 1024, "%s +photflagpoor %d", command, PhotFlagPoor);    strcpy (command, tmpline); }
     153    if (FIT_MODE == FIT_PM_ONLY)         { strextend (&command, "-pm"); }
     154    if (FIT_MODE == FIT_PAR_ONLY)        { strextend (&command, "-par"); }
     155    if (FIT_MODE == FIT_PM_AND_PAR)      { strextend (&command, "-pmpar"); }
     156
     157    if (VERBOSE)       { strextend (&command, "-v"); }
     158    if (VERBOSE2)      { strextend (&command, "-vv"); }
     159    if (RESET)         { strextend (&command, "-reset"); }
     160    if (UPDATE)        { strextend (&command, "-update"); }
     161    if (ImagSelect)    { strextend (&command, "-instmag %f %f", ImagMin, ImagMax); }
     162    if (MaxDensityUse) { strextend (&command, "-max-density %f", MaxDensityValue); }
     163    if (FlagOutlier)   { strextend (&command, "-clip %d", CLIP_THRESH); }
     164    if (USE_FIXED_PIXCOORDS) { strextend (&command, "-D USE_FIXED_PIXCOORDS 1"); }
     165    if (PHOTCODE_KEEP_LIST)  { strextend (&command, "+photcode %s", PHOTCODE_KEEP_LIST); }
     166    if (PHOTCODE_SKIP_LIST)  { strextend (&command, "-photcode %s", PHOTCODE_SKIP_LIST); }
     167    if (PhotFlagSelect)      { strextend (&command, "+photflags"); }
     168    if (PhotFlagBad)         { strextend (&command, "+photflagbad %d", PhotFlagBad); }
     169    if (PhotFlagPoor)        { strextend (&command, "+photflagpoor %d", PhotFlagPoor); }
    175170    // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values
    176171
    177     if (MinBadQF > 0.0)    { snprintf (tmpline, 1024, "%s -min-bad-psfqf %f",        command, MinBadQF);      strcpy (command, tmpline); }
    178     if (MaxMeanOffset != 10.0) { snprintf (tmpline, 1024, "%s -max-mean-offset  %f", command, MaxMeanOffset); strcpy (command, tmpline); }
     172    if (MinBadQF > 0.0)        { strextend (&command, "-min-bad-psfqf %f", MinBadQF); }
     173    if (MaxMeanOffset != 10.0) { strextend (&command, "-max-mean-offset  %f", MaxMeanOffset); }
    179174
    180175    if (TimeSelect) {
    181176      char *tstart = ohana_sec_to_date (TSTART);
    182177      char *tstop  = ohana_sec_to_date (TSTOP);
    183       snprintf (tmpline, 1024, "%s -time %s %s", command, tstart, tstop);
     178      strextend (&command, "-time %s %s", tstart, tstop);
    184179      free (tstart);
    185180      free (tstop);
    186       strcpy (command, tmpline);
    187181    }
    188182
  • branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_ckids.c

    r38352 r38391  
    111111    table->hosts[i].pathname = tmppath;
    112112
    113     char command[1024];
    114     snprintf (command, 1024, "ckids_client -hostID %d -catdir %s -hostdir %s -region %f %f %f %f",
     113    char *command = NULL;
     114    strextend (&command, "ckids_client -hostID %d -catdir %s -hostdir %s -region %f %f %f %f",
    115115              table->hosts[i].hostID, CATDIR, table->hosts[i].pathname,
    116116              UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
    117117
    118     char tmpline[1024];
    119     if (VERBOSE)     { snprintf (tmpline, 1024, "%s -v",          command);                          strcpy (command, tmpline); }
    120     if (SINGLE_CPT)  { snprintf (tmpline, 1024, "%s -cpt %s",     command, SINGLE_CPT);              strcpy (command, tmpline); }
    121     if (UPDATE)      { snprintf (tmpline, 1024, "%s -update",     command);                          strcpy (command, tmpline); }
     118    if (VERBOSE)     { strextend (&command, "-v"); }
     119    if (SINGLE_CPT)  { strextend (&command, "-cpt %s", SINGLE_CPT); }
     120    if (UPDATE)      { strextend (&command, "-update"); }
    122121
    123122    fprintf (stderr, "command: %s\n", command);
  • branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_fiximids.c

    r38352 r38391  
    112112    snprintf (table->hosts[i].results, 1024, "%s/fiximids.results.%s.dat", table->hosts[i].pathname, uniquer);
    113113
    114     char command[1024];
    115     snprintf (command, 1024, "fiximids_client -hostID %d -catdir %s -hostdir %s -images %s -region %f %f %f %f",
     114    char *command = NULL;
     115    strextend (&command, "fiximids_client -hostID %d -catdir %s -hostdir %s -images %s -region %f %f %f %f",
    116116              table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, imageFile,
    117117              UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
     
    119119    int saveImstats = VERBOSE_IMSTATS || SUMMARY_IMSTATS;
    120120
    121     char tmpline[1024];
    122     if (VERBOSE)     { snprintf (tmpline, 1024, "%s -v",          command);                          strcpy (command, tmpline); }
    123     if (saveImstats) { snprintf (tmpline, 1024, "%s -imstats %s", command, table->hosts[i].results); strcpy (command, tmpline); }
    124     if (SINGLE_CPT)  { snprintf (tmpline, 1024, "%s -cpt %s",     command, SINGLE_CPT);              strcpy (command, tmpline); }
    125     if (UPDATE)      { snprintf (tmpline, 1024, "%s -update",     command);                          strcpy (command, tmpline); }
     121    if (VERBOSE)     { strextend (&command, "-v"); }
     122    if (saveImstats) { strextend (&command, "-imstats %s", table->hosts[i].results); }
     123    if (SINGLE_CPT)  { strextend (&command, "-cpt %s", SINGLE_CPT); }
     124    if (UPDATE)      { strextend (&command, "-update"); }
    126125
    127126    fprintf (stderr, "command: %s\n", command);
  • branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_fixstkids.c

    r38352 r38391  
    127127    snprintf (table->hosts[i].results, 1024, "%s/fixstkids.results.%s.dat", table->hosts[i].pathname, uniquer);
    128128
    129     char command[1024];
    130     snprintf (command, 1024, "fixstkids_client -hostID %d -catdir %s -hostdir %s -images %s -region %f %f %f %f",
     129    char *command = NULL;
     130    strextend (&command, "fixstkids_client -hostID %d -catdir %s -hostdir %s -images %s -region %f %f %f %f",
    131131              table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, imageFile,
    132132              UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
     
    134134    int saveImstats = VERBOSE_IMSTATS || SUMMARY_IMSTATS;
    135135
    136     char tmpline[1024];
    137     if (VERBOSE)     { snprintf (tmpline, 1024, "%s -v",          command);                          strcpy (command, tmpline); }
    138     if (saveImstats) { snprintf (tmpline, 1024, "%s -imstats %s", command, table->hosts[i].results); strcpy (command, tmpline); }
    139     if (SINGLE_CPT)  { snprintf (tmpline, 1024, "%s -cpt %s",     command, SINGLE_CPT);              strcpy (command, tmpline); }
    140     if (UPDATE)      { snprintf (tmpline, 1024, "%s -update",     command);                          strcpy (command, tmpline); }
     136    if (VERBOSE)     { strextend (&command, "-v"); }
     137    if (saveImstats) { strextend (&command, "-imstats %s", table->hosts[i].results); }
     138    if (SINGLE_CPT)  { strextend (&command, "-cpt %s", SINGLE_CPT); }
     139    if (UPDATE)      { strextend (&command, "-update"); }
    141140
    142141    fprintf (stderr, "command: %s\n", command);
  • branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_setastrom.c

    r38352 r38391  
    9595    table->hosts[i].pathname = tmppath;
    9696
    97     char command[1024];
    98     snprintf (command, 1024, "setastrom_client -hostID %d -catdir %s -hostdir %s -region %f %f %f %f",
     97    char *command = NULL;
     98    strextend (&command, "setastrom_client -hostID %d -catdir %s -hostdir %s -region %f %f %f %f",
    9999              table->hosts[i].hostID, CATDIR, table->hosts[i].pathname,
    100100              UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
    101101
    102     char tmpline[1024];
    103     if (VERBOSE)          { snprintf (tmpline, 1024, "%s -v",                   command);                   strcpy (command, tmpline); }
    104     if (UPDATE)           { snprintf (tmpline, 1024, "%s -update",              command);                   strcpy (command, tmpline); }
    105     if (KH_FILE)          { snprintf (tmpline, 1024, "%s -KH %s",               command, KH_FILE);          strcpy (command, tmpline); }
    106     if (DCR_FILE)         { snprintf (tmpline, 1024, "%s -DCR %s",              command, DCR_FILE);         strcpy (command, tmpline); }
    107     if (CAM_FILE)         { snprintf (tmpline, 1024, "%s -CAM %s",              command, CAM_FILE);         strcpy (command, tmpline); }
    108     if (UPDATE_CATFORMAT) { snprintf (tmpline, 1024, "%s -update-catformat %s", command, UPDATE_CATFORMAT); strcpy (command, tmpline); }
    109 
    110     if (KH_RESET)         { snprintf (tmpline, 1024, "%s -KH-reset",            command);                   strcpy (command, tmpline); }
    111     if (DCR_RESET)        { snprintf (tmpline, 1024, "%s -DCR-reset",           command);                   strcpy (command, tmpline); }
    112     if (CAM_RESET)        { snprintf (tmpline, 1024, "%s -CAM-reset",           command);                   strcpy (command, tmpline); }
     102    if (VERBOSE)          { strextend (&command, "-v"); }
     103    if (UPDATE)           { strextend (&command, "-update"); }
     104    if (KH_FILE)          { strextend (&command, "-KH %s", KH_FILE); }
     105    if (DCR_FILE)         { strextend (&command, "-DCR %s", DCR_FILE); }
     106    if (CAM_FILE)         { strextend (&command, "-CAM %s", CAM_FILE); }
     107    if (UPDATE_CATFORMAT) { strextend (&command, "-update-catformat %s", UPDATE_CATFORMAT); }
     108    if (KH_RESET)         { strextend (&command, "-KH-reset"); }
     109    if (DCR_RESET)        { strextend (&command, "-DCR-reset"); }
     110    if (CAM_RESET)        { strextend (&command, "-CAM-reset"); }
    113111
    114112    fprintf (stderr, "command: %s\n", command);
  • branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_setgalmodel.c

    r38352 r38391  
    9191    table->hosts[i].pathname = tmppath;
    9292
    93     char command[1024];
    94     snprintf (command, 1024, "setgalmodel_client -hostID %d -catdir %s -hostdir %s -region %f %f %f %f",
     93    char *command = NULL;
     94    strextend (&command, "setgalmodel_client -hostID %d -catdir %s -hostdir %s -region %f %f %f %f",
    9595              table->hosts[i].hostID, CATDIR, table->hosts[i].pathname,
    9696              UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
    9797
     98    if (VERBOSE)          { strextend (&command, "-v"); }
     99    if (TESTING)          { strextend (&command, "-testing"); }
     100    if (UPDATE)           { strextend (&command, "-update"); }
     101    if (UPDATE_CATFORMAT) { strextend (&command, "-update-catformat %s", UPDATE_CATFORMAT); }
     102
    98103    fprintf (stderr, "command: %s\n", command);
    99 
    100     char tmpline[1024];
    101     if (VERBOSE)          { snprintf (tmpline, 1024, "%s -v",                   command);                   strcpy (command, tmpline); }
    102     if (TESTING)          { snprintf (tmpline, 1024, "%s -testing",             command);                   strcpy (command, tmpline); }
    103     if (UPDATE)           { snprintf (tmpline, 1024, "%s -update",              command);                   strcpy (command, tmpline); }
    104     if (UPDATE_CATFORMAT) { snprintf (tmpline, 1024, "%s -update-catformat %s", command, UPDATE_CATFORMAT); strcpy (command, tmpline); }
    105104
    106105    if (PARALLEL_MANUAL) continue;
  • branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_setphot.c

    r38352 r38391  
    110110    table->hosts[i].pathname = tmppath;
    111111
    112     char command[1024];
    113     snprintf (command, 1024, "setphot_client -hostID %d -catdir %s -hostdir %s -images %s -region %f %f %f %f",
     112    char *command = NULL;
     113    strextend (&command, "setphot_client -hostID %d -catdir %s -hostdir %s -images %s -region %f %f %f %f",
    114114              table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, imageFile,
    115115              UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
    116116
     117    if (VERBOSE)       { strextend (&command, "-v"); }
     118    if (RESET)         { strextend (&command, "-reset"); }
     119    if (UPDATE)        { strextend (&command, "-update"); }
     120    if (UBERCAL)       { strextend (&command, "-ubercal"); }
     121
    117122    fprintf (stderr, "command: %s\n", command);
    118 
    119     char tmpline[1024];
    120     if (VERBOSE)       { snprintf (tmpline, 1024, "%s -v",              command);                    strcpy (command, tmpline); }
    121     if (RESET)         { snprintf (tmpline, 1024, "%s -reset",          command);                    strcpy (command, tmpline); }
    122     if (UPDATE)        { snprintf (tmpline, 1024, "%s -update",         command);                    strcpy (command, tmpline); }
    123     if (UBERCAL)       { snprintf (tmpline, 1024, "%s -ubercal",        command);                    strcpy (command, tmpline); }
    124123
    125124    if (PARALLEL_MANUAL) continue;
  • branches/eam_branches/ohana.20150429/src/uniphot/src/update_dvo_setposangle.c

    r38352 r38391  
    112112    table->hosts[i].pathname = tmppath;
    113113
    114     char command[1024];
    115     snprintf (command, 1024, "setposangle_client -hostID %d -catdir %s -hostdir %s -images %s -region %f %f %f %f",
     114    char *command = NULL;
     115    strextend (&command, "setposangle_client -hostID %d -catdir %s -hostdir %s -images %s -region %f %f %f %f",
    116116              table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, imageFile,
    117117              UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
    118118
     119    if (VERBOSE)       { strextend (&command, "-v"); }
     120    if (UPDATE)        { strextend (&command, "-update"); }
     121
    119122    fprintf (stderr, "command: %s\n", command);
    120 
    121     char tmpline[1024];
    122     if (VERBOSE)       { snprintf (tmpline, 1024, "%s -v",              command);                    strcpy (command, tmpline); }
    123     if (UPDATE)        { snprintf (tmpline, 1024, "%s -update",         command);                    strcpy (command, tmpline); }
    124123
    125124    if (PARALLEL_MANUAL) continue;
Note: See TracChangeset for help on using the changeset viewer.