IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 12, 2015, 6:18:23 PM (11 years ago)
Author:
eugene
Message:

merge changes from EAM dev branch ohana.20150429

Location:
trunk/Ohana
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/relastro/include/relastro.h

    r38062 r38441  
    539539int hpm_objects (SkyRegion *region, Catalog *catalog);
    540540
    541 int strextend (char *input, char *format,...);
    542541int launch_region_hosts (RegionHostTable *regionHosts);
    543542
     
    591590float getColorBlue (off_t meas, int cat);
    592591float getColorRed (off_t meas, int cat);
    593 
    594 int strextend (char *input, char *format,...);
    595592
    596593int areImagesLoaded ();
  • trunk/Ohana/src/relastro/src/BrightCatalog.c

    r38062 r38441  
    172172    GET_COLUMN(Nmeasure,       "NMEASURE",       short);
    173173    GET_COLUMN(Nmissing,       "NMISSING",       short);
    174     GET_COLUMN(Nextend,        "NEXTEND",        short);
     174    GET_COLUMN(Ngalphot,      "NGALPHOT",      short);
    175175    GET_COLUMN(measureOffset,  "OFF_MEASURE",    int);
    176176    GET_COLUMN(missingOffset,  "OFF_MISSING",    int);
     
    208208      average[i].Nmeasure        = Nmeasure[i]        ;
    209209      average[i].Nmissing        = Nmissing[i]        ;
    210       average[i].Nextend         = Nextend[i]         ;
     210      average[i].Ngalphot       = Ngalphot[i]         ;
    211211      average[i].measureOffset   = measureOffset[i]   ;
    212212      average[i].missingOffset   = missingOffset[i]   ;
     
    241241    free (Nmeasure);
    242242    free (Nmissing);
    243     free (Nextend);
     243    free (Ngalphot);
    244244    free (measureOffset);
    245245    free (missingOffset);
     
    502502    gfits_define_bintable_column (&theader, "I", "NMEASURE",       "number of psf measurements",                          "", 1.0, 0.0);
    503503    gfits_define_bintable_column (&theader, "I", "NMISSING",       "number of missings",                                  "", 1.0, 0.0);
    504     gfits_define_bintable_column (&theader, "I", "NEXTEND",        "number of extended measurements",                     "", 1.0, 0.0);
     504    gfits_define_bintable_column (&theader, "I", "NGALPHOT",      "number of galaxy shape measurements",                 "", 1.0, 0.0);
    505505    gfits_define_bintable_column (&theader, "J", "OFF_MEASURE",    "offset to first psf measurement",                     "", 1.0, 0.0);
    506506    gfits_define_bintable_column (&theader, "J", "OFF_MISSING",    "offset to first missing obs",                         "", 1.0, 0.0);
     
    537537    short    *Nmeasure      ; ALLOCATE (Nmeasure      , short   , catalog->Naverage);
    538538    short    *Nmissing      ; ALLOCATE (Nmissing      , short   , catalog->Naverage);
    539     short    *Nextend       ; ALLOCATE (Nextend       , short   , catalog->Naverage);
     539    short    *Ngalphot     ; ALLOCATE (Ngalphot     , short   , catalog->Naverage);
    540540    int      *measureOffset ; ALLOCATE (measureOffset , int     , catalog->Naverage);
    541541    int      *missingOffset ; ALLOCATE (missingOffset , int     , catalog->Naverage);
     
    571571      Nmeasure[i]        = average[i].Nmeasure        ;
    572572      Nmissing[i]        = average[i].Nmissing        ;
    573       Nextend[i]         = average[i].Nextend         ;
     573      Ngalphot[i]       = average[i].Ngalphot       ;
    574574      measureOffset[i]   = average[i].measureOffset   ;
    575575      missingOffset[i]   = average[i].missingOffset   ;
     
    604604    gfits_set_bintable_column (&theader, &ftable, "NMEASURE",       Nmeasure,        catalog->Naverage);
    605605    gfits_set_bintable_column (&theader, &ftable, "NMISSING",       Nmissing,        catalog->Naverage);
    606     gfits_set_bintable_column (&theader, &ftable, "NEXTEND",        Nextend,         catalog->Naverage);
     606    gfits_set_bintable_column (&theader, &ftable, "NGALPHOT",      Ngalphot,       catalog->Naverage);
    607607    gfits_set_bintable_column (&theader, &ftable, "OFF_MEASURE",    measureOffset,   catalog->Naverage);
    608608    gfits_set_bintable_column (&theader, &ftable, "OFF_MISSING",    missingOffset,   catalog->Naverage);
     
    635635    free (Nmeasure);
    636636    free (Nmissing);
    637     free (Nextend);
     637    free (Ngalphot);
    638638    free (measureOffset);
    639639    free (missingOffset);
  • trunk/Ohana/src/relastro/src/ImageTable.c

    r36630 r38441  
    77  FITS_DB db;
    88
     9  gfits_db_init (&db);
    910  db.mode   = dvo_catalog_catmode (CATMODE);
    1011  db.format = dvo_catalog_catformat (CATFORMAT);
     
    2728  // convert database table to internal structure (binary to Image)
    2829  // 'image' points to the same memory as db->ftable->buffer
    29   Image *image = gfits_table_get_Image (&db.ftable, &Nimage, &db.swapped);
     30  Image *image = gfits_table_get_Image (&db.ftable, &Nimage, &db.scaledValue, &db.nativeOrder);
    3031  if (!image) {
    3132    Shutdown ("ERROR: failed to read images");
     
    4243
    4344  // setup image table format and lock
     45  gfits_db_init (&db);
    4446  db.mode   = dvo_catalog_catmode (CATMODE);
    4547  db.format = dvo_catalog_catformat (CATFORMAT);
  • trunk/Ohana/src/relastro/src/UpdateObjectOffsets.c

    r37807 r38441  
    3434    catalog.catformat = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
    3535    catalog.catmode   = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
    36     catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
     36    catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
    3737    catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
    3838
     
    4141      exit (1);
    4242    }
    43     if (!catalog.Naves_disk) {
     43    if (!catalog.Naverage_disk) {
    4444      if (VERBOSE2) fprintf (stderr, "no data in %s, skipping\n", catalog.filename);
    4545      dvo_catalog_unlock (&catalog);
     
    102102
    103103  int Ngroups;
    104   HostTableGroup *groups = HostTableGroups (table, &Ngroups);
     104  HostTableGroup *groups = HostTableGroupsUniqueMachines (table, &Ngroups);
    105105  // split the table into Ngroups, each with a unique set of machines (this avoids overloading the remote host machines)
    106106
     
    152152    // MaxDensityUse, MaxDensityValue
    153153
    154     char command[1024];
    155     snprintf (command, 1024, "relastro_client -update-offsets -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s -minerror %f",
     154    char *command = NULL;
     155    strextend (&command, "relastro_client -update-offsets -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s -minerror %f",
    156156              group->hosts[i][0].hostID, CATDIR, group->hosts[i][0].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, STATMODE, MIN_ERROR);
    157157
    158     if (FIT_MODE == FIT_PM_ONLY)         strextend (command, "-pm");
    159     if (FIT_MODE == FIT_PAR_ONLY)        strextend (command, "-par");
    160     if (FIT_MODE == FIT_PM_AND_PAR)      strextend (command, "-pmpar");
    161 
    162     if (VERBOSE)       strextend (command, "-v");
    163     if (VERBOSE2)      strextend (command, "-vv");
    164     if (RESET)         strextend (command, "-reset");
    165     if (UPDATE)        strextend (command, "-update");
    166 
    167     if (RESET_BAD_IMAGES) strextend (command, "-reset-bad-images");
    168 
    169     if (ImagSelect)    strextend (command, "-instmag %f %f", ImagMin, ImagMax);
    170     if (MaxDensityUse) strextend (command, "-max-density %f", MaxDensityValue);
    171    
    172     if (USE_BASIC_CHECK) strextend (command, "-basic-image-search");
    173     if (FlagOutlier)     strextend (command, "-clip %d", CLIP_THRESH);
    174     if (ExcludeBogus)    strextend (command, "-exclude-bogus %f", ExcludeBogusRadius);
    175    
    176     if (USE_FIXED_PIXCOORDS) strextend (command, "-D USE_FIXED_PIXCOORDS 1");
    177 
    178     if (PHOTCODE_KEEP_LIST) strextend (command, "+photcode %s", PHOTCODE_KEEP_LIST);
    179     if (PHOTCODE_SKIP_LIST) strextend (command, "-photcode %s", PHOTCODE_SKIP_LIST);
    180     if (PhotFlagSelect)     strextend (command, "+photflags");
    181     if (PhotFlagBad)        strextend (command, "+photflagbad %d", PhotFlagBad);
    182     if (PhotFlagPoor)       strextend (command, "+photflagpoor %d", PhotFlagPoor);
     158    if (FIT_MODE == FIT_PM_ONLY)         strextend (&command, "-pm");
     159    if (FIT_MODE == FIT_PAR_ONLY)        strextend (&command, "-par");
     160    if (FIT_MODE == FIT_PM_AND_PAR)      strextend (&command, "-pmpar");
     161
     162    if (VERBOSE)       strextend (&command, "-v");
     163    if (VERBOSE2)      strextend (&command, "-vv");
     164    if (RESET)         strextend (&command, "-reset");
     165    if (UPDATE)        strextend (&command, "-update");
     166
     167    if (RESET_BAD_IMAGES) strextend (&command, "-reset-bad-images");
     168
     169    if (ImagSelect)    strextend (&command, "-instmag %f %f", ImagMin, ImagMax);
     170    if (MaxDensityUse) strextend (&command, "-max-density %f", MaxDensityValue);
     171   
     172    if (USE_BASIC_CHECK) strextend (&command, "-basic-image-search");
     173    if (FlagOutlier)     strextend (&command, "-clip %d", CLIP_THRESH);
     174    if (ExcludeBogus)    strextend (&command, "-exclude-bogus %f", ExcludeBogusRadius);
     175   
     176    if (USE_FIXED_PIXCOORDS) strextend (&command, "-D USE_FIXED_PIXCOORDS 1");
     177
     178    if (PHOTCODE_KEEP_LIST) strextend (&command, "+photcode %s", PHOTCODE_KEEP_LIST);
     179    if (PHOTCODE_SKIP_LIST) strextend (&command, "-photcode %s", PHOTCODE_SKIP_LIST);
     180    if (PhotFlagSelect)     strextend (&command, "+photflags");
     181    if (PhotFlagBad)        strextend (&command, "+photflagbad %d", PhotFlagBad);
     182    if (PhotFlagPoor)       strextend (&command, "+photflagpoor %d", PhotFlagPoor);
    183183    // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values
    184184
    185185    if (DCR_BLUE_COLOR_POS && DCR_BLUE_COLOR_NEG) {
    186       strextend (command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG);
     186      strextend (&command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG);
    187187    }
    188188    if (DCR_RED_COLOR_POS && DCR_RED_COLOR_NEG) {
    189       strextend (command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG);
    190     }
    191 
    192     if (MinBadQF > 0.0)        strextend (command, "-min-bad-psfqf %f", MinBadQF);
    193     if (MaxMeanOffset != 10.0) strextend (command, "-max-mean-offset  %f", MaxMeanOffset);
     189      strextend (&command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG);
     190    }
     191
     192    if (MinBadQF > 0.0)        strextend (&command, "-min-bad-psfqf %f", MinBadQF);
     193    if (MaxMeanOffset != 10.0) strextend (&command, "-max-mean-offset  %f", MaxMeanOffset);
    194194
    195195    if (TimeSelect) {
    196196      char *tstart = ohana_sec_to_date (TSTART);
    197197      char *tstop  = ohana_sec_to_date (TSTOP);
    198       strextend (command, "-time %s %s", tstart, tstop);
     198      strextend (&command, "-time %s %s", tstart, tstop);
    199199      free (tstart);
    200200      free (tstop);
     
    270270    // MaxDensityUse, MaxDensityValue
    271271
    272     char command[1024];
    273     snprintf (command, 1024, "relastro_client -update-offsets -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s -minerror %f",
     272    char *command = NULL;
     273    strextend (&command, "relastro_client -update-offsets -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s -minerror %f",
    274274              table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, STATMODE, MIN_ERROR);
    275275
    276     if (FIT_MODE == FIT_PM_ONLY)         strextend (command, "-pm");
    277     if (FIT_MODE == FIT_PAR_ONLY)        strextend (command, "-par");
    278     if (FIT_MODE == FIT_PM_AND_PAR)      strextend (command, "-pmpar");
    279 
    280     if (VERBOSE)       strextend (command, "-v");
    281     if (VERBOSE2)      strextend (command, "-vv");
    282     if (RESET)         strextend (command, "-reset");
    283     if (UPDATE)        strextend (command, "-update");
    284 
    285     if (RESET_BAD_IMAGES) strextend (command, "-reset-bad-images");
    286 
    287     if (ImagSelect)    strextend (command, "-instmag %f %f", ImagMin, ImagMax);
    288     if (MaxDensityUse) strextend (command, "-max-density %f", MaxDensityValue);
    289    
    290     if (USE_BASIC_CHECK) strextend (command, "-basic-image-search");
    291     if (FlagOutlier)     strextend (command, "-clip %d", CLIP_THRESH);
    292     if (ExcludeBogus)    strextend (command, "-exclude-bogus %f", ExcludeBogusRadius);
    293    
    294     if (USE_FIXED_PIXCOORDS) strextend (command, "-D USE_FIXED_PIXCOORDS 1");
    295 
    296     if (PHOTCODE_KEEP_LIST) strextend (command, "+photcode %s", PHOTCODE_KEEP_LIST);
    297     if (PHOTCODE_SKIP_LIST) strextend (command, "-photcode %s", PHOTCODE_SKIP_LIST);
    298     if (PhotFlagSelect)     strextend (command, "+photflags");
    299     if (PhotFlagBad)        strextend (command, "+photflagbad %d", PhotFlagBad);
    300     if (PhotFlagPoor)       strextend (command, "+photflagpoor %d", PhotFlagPoor);
     276    if (FIT_MODE == FIT_PM_ONLY)         strextend (&command, "-pm");
     277    if (FIT_MODE == FIT_PAR_ONLY)        strextend (&command, "-par");
     278    if (FIT_MODE == FIT_PM_AND_PAR)      strextend (&command, "-pmpar");
     279
     280    if (VERBOSE)       strextend (&command, "-v");
     281    if (VERBOSE2)      strextend (&command, "-vv");
     282    if (RESET)         strextend (&command, "-reset");
     283    if (UPDATE)        strextend (&command, "-update");
     284
     285    if (RESET_BAD_IMAGES) strextend (&command, "-reset-bad-images");
     286
     287    if (ImagSelect)    strextend (&command, "-instmag %f %f", ImagMin, ImagMax);
     288    if (MaxDensityUse) strextend (&command, "-max-density %f", MaxDensityValue);
     289   
     290    if (USE_BASIC_CHECK) strextend (&command, "-basic-image-search");
     291    if (FlagOutlier)     strextend (&command, "-clip %d", CLIP_THRESH);
     292    if (ExcludeBogus)    strextend (&command, "-exclude-bogus %f", ExcludeBogusRadius);
     293   
     294    if (USE_FIXED_PIXCOORDS) strextend (&command, "-D USE_FIXED_PIXCOORDS 1");
     295
     296    if (PHOTCODE_KEEP_LIST) strextend (&command, "+photcode %s", PHOTCODE_KEEP_LIST);
     297    if (PHOTCODE_SKIP_LIST) strextend (&command, "-photcode %s", PHOTCODE_SKIP_LIST);
     298    if (PhotFlagSelect)     strextend (&command, "+photflags");
     299    if (PhotFlagBad)        strextend (&command, "+photflagbad %d", PhotFlagBad);
     300    if (PhotFlagPoor)       strextend (&command, "+photflagpoor %d", PhotFlagPoor);
    301301    // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values
    302302
    303303    if (DCR_BLUE_COLOR_POS && DCR_BLUE_COLOR_NEG) {
    304       strextend (command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG);
     304      strextend (&command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG);
    305305    }
    306306    if (DCR_RED_COLOR_POS && DCR_RED_COLOR_NEG) {
    307       strextend (command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG);
    308     }
    309 
    310     if (MinBadQF > 0.0)        strextend (command, "-min-bad-psfqf %f", MinBadQF);
    311     if (MaxMeanOffset != 10.0) strextend (command, "-max-mean-offset  %f", MaxMeanOffset);
     307      strextend (&command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG);
     308    }
     309
     310    if (MinBadQF > 0.0)        strextend (&command, "-min-bad-psfqf %f", MinBadQF);
     311    if (MaxMeanOffset != 10.0) strextend (&command, "-max-mean-offset  %f", MaxMeanOffset);
    312312
    313313    if (TimeSelect) {
    314314      char *tstart = ohana_sec_to_date (TSTART);
    315315      char *tstop  = ohana_sec_to_date (TSTOP);
    316       strextend (command, "-time %s %s", tstart, tstop);
     316      strextend (&command, "-time %s %s", tstart, tstop);
    317317      free (tstart);
    318318      free (tstop);
  • trunk/Ohana/src/relastro/src/args.c

    r37807 r38441  
    959959}
    960960
    961 int strextend (char *input, char *format,...) {
    962 
    963   char tmpextra[1024], tmpline[1024];
    964   va_list argp;
    965 
    966   va_start (argp, format);
    967   vsnprintf (tmpextra, 1024, format, argp);
    968   snprintf (tmpline, 1024, "%s %s", input, tmpextra);
    969   strcpy (input, tmpline);
    970 
    971   return TRUE;
    972 }
  • trunk/Ohana/src/relastro/src/assign_images.c

    r37807 r38441  
    1111  // convert database table to internal structure (binary to Image)
    1212  // 'image' points to the same memory as db->ftable->buffer
    13   Image *image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].swapped);
     13  Image *image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].scaledValue, &db[0].nativeOrder);
    1414  if (!image) {
    1515      fprintf (stderr, "ERROR: failed to read images\n");
  • trunk/Ohana/src/relastro/src/bcatalog.c

    r37807 r38441  
    521521  subcatalog[0].Nmeasure = Nmeasure;
    522522  subcatalog[0].Nsecfilt = oldcatalog[0].Nsecfilt;
    523   subcatalog[0].Nsecf_mem = Naverage * oldcatalog[0].Nsecfilt;
     523  subcatalog[0].Nsecfilt_mem = Naverage * oldcatalog[0].Nsecfilt;
    524524
    525525  return (TRUE);
     
    628628  subcatalog[0].Nmeasure = Nmeasure;
    629629  subcatalog[0].Nsecfilt = oldcatalog[0].Nsecfilt;
    630   subcatalog[0].Nsecf_mem = Naverage * oldcatalog[0].Nsecfilt;
     630  subcatalog[0].Nsecfilt_mem = Naverage * oldcatalog[0].Nsecfilt;
    631631
    632632  return (TRUE);
     
    722722  subcatalog[0].Nmeasure = Nmeasure;
    723723  subcatalog[0].Nsecfilt = catalog[0].Nsecfilt;
    724   subcatalog[0].Nsecf_mem = Naverage * catalog[0].Nsecfilt;
     724  subcatalog[0].Nsecfilt_mem = Naverage * catalog[0].Nsecfilt;
    725725
    726726  return (TRUE);
  • trunk/Ohana/src/relastro/src/high_speed_catalogs.c

    r35763 r38441  
    3131    catalog.catformat = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
    3232    catalog.catmode   = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
    33     catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
     33    catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
    3434    catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
    3535
     
    3838      exit (1);
    3939    }
    40     if (!catalog.Naves_disk) {
     40    if (!catalog.Naverage_disk) {
    4141      if (VERBOSE2) fprintf (stderr, "no data in %s, skipping\n", catalog.filename);
    4242      dvo_catalog_unlock (&catalog);
     
    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
  • trunk/Ohana/src/relastro/src/high_speed_objects.c

    r37807 r38441  
    3232  catalogOut.filename = filename; // based on the input name, need to keep everything below the catdir portion
    3333  catalogOut.Nsecfilt = Nsecfilt;
    34   catalogOut.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF; // load all data
     34  catalogOut.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT; // load all data
    3535 
    3636  catalogOut.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
     
    263263  catalogOut.Nmeasure=Nmatchmeas;
    264264  catalogOut.Nsecfilt=Nsecfilt;
    265   catalogOut.Nsecf_mem=Nmatch*Nsecfilt;
     265  catalogOut.Nsecfilt_mem=Nmatch*Nsecfilt;
    266266
    267267  populate_tiny_values (&catalogOut, DVO_TV_MEASURE);
  • trunk/Ohana/src/relastro/src/hpm_catalogs.c

    r35763 r38441  
    2929    catalog.catformat = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
    3030    catalog.catmode   = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
    31     catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
     31    catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
    3232    catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
    3333
     
    3636      exit (1);
    3737    }
    38     if (!catalog.Naves_disk) {
     38    if (!catalog.Naverage_disk) {
    3939      if (VERBOSE2) fprintf (stderr, "no data in %s, skipping\n", catalog.filename);
    4040      dvo_catalog_unlock (&catalog);
     
    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
  • trunk/Ohana/src/relastro/src/hpm_objects.c

    r37807 r38441  
    3333  catalogOut.filename = filename;
    3434  catalogOut.Nsecfilt = Nsecfilt;
    35   catalogOut.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF; // load all data
     35  catalogOut.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT; // load all data
    3636 
    3737  catalogOut.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
     
    279279  }
    280280  catalogOut.Nsecfilt = Nsecfilt;
    281   catalogOut.Nsecf_mem = Nsecfilt * catalogOut.Naverage;
     281  catalogOut.Nsecfilt_mem = Nsecfilt * catalogOut.Naverage;
    282282
    283283  populate_tiny_values (&catalogOut, DVO_TV_MEASURE);
  • trunk/Ohana/src/relastro/src/launch_region_hosts.c

    r37807 r38441  
    7777    }
    7878
    79     char command[1024];
    80     snprintf (command, 1024, "relastro -parallel-images %s", filename);
    81     strextend (command, "-region-hosts %s", REGION_FILE);
    82     strextend (command, "-region-hostID %d", host->hostID);
    83     strextend (command, "-D CATDIR %s", CATDIR);
    84     strextend (command, "-region %f %f %f %f", host->RminCat, host->RmaxCat, host->DminCat, host->DmaxCat);
    85     strextend (command, "-statmode %s", STATMODE);
    86     strextend (command, "-minerror %f", MIN_ERROR);
    87     strextend (command, "-nloop %d", NLOOP);
    88     strextend (command, "-threads %d", NTHREADS);
     79    char *command = NULL;
     80    strextend (&command, "relastro -parallel-images %s", filename);
     81    strextend (&command, "-region-hosts %s", REGION_FILE);
     82    strextend (&command, "-region-hostID %d", host->hostID);
     83    strextend (&command, "-D CATDIR %s", CATDIR);
     84    strextend (&command, "-region %f %f %f %f", host->RminCat, host->RmaxCat, host->DminCat, host->DmaxCat);
     85    strextend (&command, "-statmode %s", STATMODE);
     86    strextend (&command, "-minerror %f", MIN_ERROR);
     87    strextend (&command, "-nloop %d", NLOOP);
     88    strextend (&command, "-threads %d", NTHREADS);
    8989
    9090    switch (FIT_TARGET) {
    9191      case TARGET_SIMPLE:
    92         strextend (command, "-update-simple");
     92        strextend (&command, "-update-simple");
    9393        break;
    9494      case TARGET_CHIPS:
    95         strextend (command, "-update-chips");
     95        strextend (&command, "-update-chips");
    9696        break;
    9797      case TARGET_MOSAICS:
    98         strextend (command, "-update-mosaics");
     98        strextend (&command, "-update-mosaics");
    9999        break;
    100100      case TARGET_NONE:
     
    102102    }
    103103
    104     if (VERBOSE)            strextend (command, "-v");
    105     if (VERBOSE2)           strextend (command, "-vv");
    106     if (RESET)              strextend (command, "-reset");
    107     if (UPDATE)             strextend (command, "-update");
    108     if (PARALLEL)           strextend (command, "-parallel");
    109     if (PARALLEL_MANUAL)    strextend (command, "-parallel-manual");
    110     if (PARALLEL_SERIAL)    strextend (command, "-parallel-serial");
    111     if (PHOTCODE_KEEP_LIST) strextend (command, "+photcode %s", PHOTCODE_KEEP_LIST);
    112     if (PHOTCODE_SKIP_LIST) strextend (command, "-photcode %s", PHOTCODE_SKIP_LIST);
    113     if (PHOTCODE_RESET_LIST) strextend (command, "-reset-to-photcode %s", PHOTCODE_RESET_LIST);
     104    if (VERBOSE)            strextend (&command, "-v");
     105    if (VERBOSE2)           strextend (&command, "-vv");
     106    if (RESET)              strextend (&command, "-reset");
     107    if (UPDATE)             strextend (&command, "-update");
     108    if (PARALLEL)           strextend (&command, "-parallel");
     109    if (PARALLEL_MANUAL)    strextend (&command, "-parallel-manual");
     110    if (PARALLEL_SERIAL)    strextend (&command, "-parallel-serial");
     111    if (PHOTCODE_KEEP_LIST) strextend (&command, "+photcode %s", PHOTCODE_KEEP_LIST);
     112    if (PHOTCODE_SKIP_LIST) strextend (&command, "-photcode %s", PHOTCODE_SKIP_LIST);
     113    if (PHOTCODE_RESET_LIST) strextend (&command, "-reset-to-photcode %s", PHOTCODE_RESET_LIST);
    114114
    115     if (MaxDensityUse)      strextend (command, "-max-density %f", MaxDensityValue);
    116     if (ImagSelect)         strextend (command, "-instmag %f %f", ImagMin, ImagMax);
    117     if (ExcludeBogus)       strextend (command, "-exclude-bogus %f", ExcludeBogusRadius);
     115    if (MaxDensityUse)      strextend (&command, "-max-density %f", MaxDensityValue);
     116    if (ImagSelect)         strextend (&command, "-instmag %f %f", ImagMin, ImagMax);
     117    if (ExcludeBogus)       strextend (&command, "-exclude-bogus %f", ExcludeBogusRadius);
    118118
    119119    if (DCR_BLUE_COLOR_POS && DCR_BLUE_COLOR_NEG) {
    120       strextend (command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG);
     120      strextend (&command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG);
    121121    }
    122122    if (DCR_RED_COLOR_POS && DCR_RED_COLOR_NEG) {
    123       strextend (command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG);
     123      strextend (&command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG);
    124124    }
    125125
    126     if (PhotFlagSelect)     strextend (command, "+photflags");
    127     if (PhotFlagBad)        strextend (command, "+photflagbad %d", PhotFlagBad);
    128     if (PhotFlagPoor)       strextend (command, "+photflagpoor %d", PhotFlagPoor);
     126    if (PhotFlagSelect)     strextend (&command, "+photflags");
     127    if (PhotFlagBad)        strextend (&command, "+photflagbad %d", PhotFlagBad);
     128    if (PhotFlagPoor)       strextend (&command, "+photflagpoor %d", PhotFlagPoor);
    129129
    130     if (CHIPMAP)            strextend (command, "-chipmap %d", CHIPMAP);
    131     if (RESET_IMAGES)       strextend (command, "-reset-images");
     130    if (CHIPMAP)            strextend (&command, "-chipmap %d", CHIPMAP);
     131    if (RESET_IMAGES)       strextend (&command, "-reset-images");
    132132
    133     if (MinBadQF > 0.0)        strextend (command, "-min-bad-psfqf %f", MinBadQF);
    134     if (MaxMeanOffset != 10.0) strextend (command, "-max-mean-offset  %f", MaxMeanOffset);
     133    if (MinBadQF > 0.0)        strextend (&command, "-min-bad-psfqf %f", MinBadQF);
     134    if (MaxMeanOffset != 10.0) strextend (&command, "-max-mean-offset  %f", MaxMeanOffset);
    135135
    136     strextend (command, "-D RELASTRO_SRC_MEAS_TOOFEW %d", SRC_MEAS_TOOFEW);
    137     strextend (command, "-D RELASTRO_SIGMA_LIM %f", SIGMA_LIM);
    138     strextend (command, "-D RELASTRO_DPOS_MAX %f", DPOS_MAX);
    139     strextend (command, "-D ADDSTAR_RADIUS %f", ADDSTAR_RADIUS);
     136    strextend (&command, "-D RELASTRO_SRC_MEAS_TOOFEW %d", SRC_MEAS_TOOFEW);
     137    strextend (&command, "-D RELASTRO_SIGMA_LIM %f", SIGMA_LIM);
     138    strextend (&command, "-D RELASTRO_DPOS_MAX %f", DPOS_MAX);
     139    strextend (&command, "-D ADDSTAR_RADIUS %f", ADDSTAR_RADIUS);
    140140
    141     strextend (command, "-D USE_GALAXY_MODEL %d", USE_GALAXY_MODEL);
     141    strextend (&command, "-D USE_GALAXY_MODEL %d", USE_GALAXY_MODEL);
    142142
    143     strextend (command, "-D USE_ICRF_CORRECT %d", USE_ICRF_CORRECT);
    144     strextend (command, "-D USE_ICRF_LOCAL %d",   USE_ICRF_LOCAL);
    145     strextend (command, "-D USE_ICRF_SHFIT %d",   USE_ICRF_SHFIT);
    146     strextend (command, "-D USE_ICRF_POLE %d",    USE_ICRF_POLE);
     143    strextend (&command, "-D USE_ICRF_CORRECT %d", USE_ICRF_CORRECT);
     144    strextend (&command, "-D USE_ICRF_LOCAL %d",   USE_ICRF_LOCAL);
     145    strextend (&command, "-D USE_ICRF_SHFIT %d",   USE_ICRF_SHFIT);
     146    strextend (&command, "-D USE_ICRF_POLE %d",    USE_ICRF_POLE);
    147147
    148     if (USE_FIXED_PIXCOORDS) strextend (command, "-D USE_FIXED_PIXCOORDS 1");
     148    if (USE_FIXED_PIXCOORDS) strextend (&command, "-D USE_FIXED_PIXCOORDS 1");
    149149
    150150    if (TimeSelect) {
    151151      char *tstart = ohana_sec_to_date (TSTART);
    152152      char *tstop  = ohana_sec_to_date (TSTOP);
    153       strextend (command, "-time %s %s", tstart, tstop);
     153      strextend (&command, "-time %s %s", tstart, tstop);
    154154      free (tstart);
    155155      free (tstop);
  • trunk/Ohana/src/relastro/src/load_catalogs.c

    r38062 r38441  
    4040    pcatalog->catformat = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
    4141    pcatalog->catmode   = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
    42     pcatalog->catflags  = LOAD_AVES | LOAD_MEAS | LOAD_SECF; // don't need to load all data at this point
     42    pcatalog->catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_SECFILT; // don't need to load all data at this point
    4343    pcatalog->Nsecfilt  = GetPhotcodeNsecfilt ();
    4444
     
    4848      exit (1);
    4949    }
    50     if (!pcatalog[0].Naves_disk) {
     50    if (!pcatalog[0].Naverage_disk) {
    5151      if (VERBOSE2) fprintf (stderr, "no data in %s, skipping\n", pcatalog[0].filename);
    5252      dvo_catalog_unlock (pcatalog);
     
    160160    // MaxDensityUse, MaxDensityValue
    161161
    162     char command[1024];
    163     snprintf (command, 1024, "relastro_client -load-objects %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s -minerror %f -D RELASTRO_SIGMA_LIM %f",
     162    char *command = NULL;
     163    strextend (&command, "relastro_client -load-objects %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -statmode %s -minerror %f -D RELASTRO_SIGMA_LIM %f",
    164164              table->hosts[i].results, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, STATMODE, MIN_ERROR, SIGMA_LIM);
    165165
    166     if (FIT_MODE == FIT_PM_ONLY)         strextend (command, "-pm");
    167     if (FIT_MODE == FIT_PAR_ONLY)        strextend (command, "-par");
    168     if (FIT_MODE == FIT_PM_AND_PAR)      strextend (command, "-pmpar");
    169 
    170     if (VERBOSE)       strextend (command, "-v");
    171     if (VERBOSE2)      strextend (command, "-vv");
    172     if (RESET)         strextend (command, "-reset");
    173     if (ImagSelect)    strextend (command, "-instmag %f %f", ImagMin, ImagMax);
    174     if (MaxDensityUse) strextend (command, "-max-density %f", MaxDensityValue);
    175     if (FlagOutlier)   strextend (command, "-clip %d", CLIP_THRESH);
    176     if (ExcludeBogus)  strextend (command, "-exclude-bogus %f", ExcludeBogusRadius);
    177 
    178     if (USE_ICRF_CORRECT) strextend (command, "-D USE_ICRF_CORRECT %d", USE_ICRF_CORRECT);
    179     if (USE_GALAXY_MODEL) strextend (command, "-D USE_GALAXY_MODEL %d", USE_GALAXY_MODEL);
     166    if (FIT_MODE == FIT_PM_ONLY)         strextend (&command, "-pm");
     167    if (FIT_MODE == FIT_PAR_ONLY)        strextend (&command, "-par");
     168    if (FIT_MODE == FIT_PM_AND_PAR)      strextend (&command, "-pmpar");
     169
     170    if (VERBOSE)       strextend (&command, "-v");
     171    if (VERBOSE2)      strextend (&command, "-vv");
     172    if (RESET)         strextend (&command, "-reset");
     173    if (ImagSelect)    strextend (&command, "-instmag %f %f", ImagMin, ImagMax);
     174    if (MaxDensityUse) strextend (&command, "-max-density %f", MaxDensityValue);
     175    if (FlagOutlier)   strextend (&command, "-clip %d", CLIP_THRESH);
     176    if (ExcludeBogus)  strextend (&command, "-exclude-bogus %f", ExcludeBogusRadius);
     177
     178    if (USE_ICRF_CORRECT) strextend (&command, "-D USE_ICRF_CORRECT %d", USE_ICRF_CORRECT);
     179    if (USE_GALAXY_MODEL) strextend (&command, "-D USE_GALAXY_MODEL %d", USE_GALAXY_MODEL);
    180180   
    181181    if (DCR_BLUE_COLOR_POS && DCR_BLUE_COLOR_NEG) {
    182       strextend (command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG);
     182      strextend (&command, "-dcr-blue-color %s %s", DCR_BLUE_COLOR_POS, DCR_BLUE_COLOR_NEG);
    183183    }
    184184    if (DCR_RED_COLOR_POS && DCR_RED_COLOR_NEG) {
    185       strextend (command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG);
    186     }
    187 
    188     if (USE_FIXED_PIXCOORDS) strextend (command, "-D USE_FIXED_PIXCOORDS 1");
    189     if (PHOTCODE_KEEP_LIST)  strextend (command, "+photcode %s", PHOTCODE_KEEP_LIST);
    190     if (PHOTCODE_SKIP_LIST)  strextend (command, "-photcode %s", PHOTCODE_SKIP_LIST);
    191     if (PhotFlagSelect)      strextend (command, "+photflags");
    192     if (PhotFlagBad)         strextend (command, "+photflagbad %d", PhotFlagBad);
    193     if (PhotFlagPoor)        strextend (command, "+photflagpoor %d", PhotFlagPoor);
     185      strextend (&command, "-dcr-red-color %s %s", DCR_RED_COLOR_POS, DCR_RED_COLOR_NEG);
     186    }
     187
     188    if (USE_FIXED_PIXCOORDS) strextend (&command, "-D USE_FIXED_PIXCOORDS 1");
     189    if (PHOTCODE_KEEP_LIST)  strextend (&command, "+photcode %s", PHOTCODE_KEEP_LIST);
     190    if (PHOTCODE_SKIP_LIST)  strextend (&command, "-photcode %s", PHOTCODE_SKIP_LIST);
     191    if (PhotFlagSelect)      strextend (&command, "+photflags");
     192    if (PhotFlagBad)         strextend (&command, "+photflagbad %d", PhotFlagBad);
     193    if (PhotFlagPoor)        strextend (&command, "+photflagpoor %d", PhotFlagPoor);
    194194    // XXX note that the above pass in the flag as decimal -- also note that args.c cannot handle 0xHEX values
    195195
     
    197197      char *tstart = ohana_sec_to_date (TSTART);
    198198      char *tstop  = ohana_sec_to_date (TSTOP);
    199       strextend (command, "-time %s %s", tstart, tstop);
     199      strextend (&command, "-time %s %s", tstart, tstop);
    200200      free (tstart);
    201201      free (tstop);
  • trunk/Ohana/src/relastro/src/load_images.c

    r37807 r38441  
    1616
    1717  // convert database table to internal structure
    18   image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].swapped);
     18  image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].scaledValue, &db[0].nativeOrder);
    1919  if (!image) {
    2020      fprintf (stderr, "ERROR: failed to read images\n");
  • trunk/Ohana/src/relastro/src/relastro_client.c

    r37807 r38441  
    6969     
    7070      set_db (&db);
     71      gfits_db_init (&db);
    7172
    7273      /* lock and load the image db table */
  • trunk/Ohana/src/relastro/src/relastro_images.c

    r37807 r38441  
    1111  /* register database handle with shutdown procedure */
    1212  set_db (&db);
     13  gfits_db_init (&db);
    1314
    1415  /* lock and load the image db table */
  • trunk/Ohana/src/relastro/src/relastro_merge_source.c

    r37038 r38441  
    4545  catalog_src.catformat = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
    4646  catalog_src.catmode   = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
    47   catalog_src.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
     47  catalog_src.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
    4848  catalog_src.Nsecfilt  = GetPhotcodeNsecfilt ();
    4949
     
    5252    exit (1);
    5353  }
    54   if (!catalog_src.Naves_disk) {
     54  if (!catalog_src.Naverage_disk) {
    5555    fprintf (stderr, "no data in %s, error in cat ID?\n", catalog_src.filename);
    5656    exit (1);
  • trunk/Ohana/src/relastro/src/relastro_objects.c

    r37807 r38441  
    4444    catalog.catformat = dvo_catalog_catformat (CATFORMAT);    // set the default catformat from config data
    4545    catalog.catmode   = dvo_catalog_catmode (CATMODE);        // set the default catmode from config data
    46     catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
     46    catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
    4747    catalog.Nsecfilt  = GetPhotcodeNsecfilt ();
    4848
     
    5252      exit (1);
    5353    }
    54     if (!catalog.Naves_disk) {
     54    if (!catalog.Naverage_disk) {
    5555      if (VERBOSE2) fprintf (stderr, "no data in %s, skipping\n", catalog.filename);
    5656      dvo_catalog_unlock (&catalog);
     
    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
  • trunk/Ohana/src/relastro/src/relastro_parallel_regions.c

    r37807 r38441  
    1717  // register database handle with shutdown procedure
    1818  set_db (&db);
     19  gfits_db_init (&db);
    1920  db.mode   = dvo_catalog_catmode (CATMODE);
    2021  db.format = dvo_catalog_catformat (CATFORMAT);
Note: See TracChangeset for help on using the changeset viewer.