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:
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/dvomerge/Makefile

    r37807 r38441  
    164164$(BIN)/dvoutils.$(ARCH) : $(DVOUTILS)
    165165
    166 INSTALL = dvomerge dvomerge_client dvoconvert dvosecfilt dvosecfilt_client dvorepair dvoverify dvoverify_client dvoverify
     166INSTALL = dvomerge dvomerge_client dvoconvert dvosecfilt dvosecfilt_client dvorepair dvoverify dvoverify_client dvoverify dvoutils
    167167
    168168# dependancy rules for binary code #########################
  • trunk/Ohana/src/dvomerge/include/dvomerge.h

    r37807 r38441  
    4141int    REPLACE_BY_PHOTCODE;
    4242int    FORCE_MERGE;
     43int    MAX_CLIENTS;
    4344char  *UPDATE_CATFORMAT;
     45char  *UPDATE_CATCOMPRESS;
    4446
    4547int    MATCHED_TABLES;
  • trunk/Ohana/src/dvomerge/src/LoadCatalog.c

    r37807 r38441  
    88
    99    // always load all of the data (if any exists)
    10     catalog[0].catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF | LOAD_LENSING | LOAD_LENSOBJ | LOAD_STARPAR;
     10    catalog[0].catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT | DVO_LOAD_LENSING | DVO_LOAD_LENSOBJ | DVO_LOAD_STARPAR | DVO_LOAD_GALPHOT;
    1111
    1212    catalog[0].catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
  • trunk/Ohana/src/dvomerge/src/LoadImages.c

    r29938 r38441  
    3434  }
    3535
    36   image = gfits_table_get_Image (&db->ftable, Nimage, &db->swapped);
     36  image = gfits_table_get_Image (&db->ftable, Nimage, &db->scaledValue, &db->nativeOrder);
    3737  if (!image) {
    3838    fprintf (stderr, "ERROR: failed to read images\n");
  • trunk/Ohana/src/dvomerge/src/args.c

    r38062 r38441  
    4444  }
    4545
     46  /* limit the impact of a dvomerge -parallel */
     47  MAX_CLIENTS = 10;
     48  if ((N = get_argument (*argc, argv, "-max-clients"))) {
     49    remove_argument (N, argc, argv);
     50    MAX_CLIENTS = atoi(argv[N]);
     51    remove_argument (N, argc, argv);
     52  }
     53
    4654  /* use a different photcode file to define mean values */
    4755  if ((N = get_argument (*argc, argv, "-photcode-file"))) {
     
    6270    remove_argument (N, argc, argv);
    6371    UPDATE_CATFORMAT = strcreate (argv[N]);
     72    remove_argument (N, argc, argv);
     73  }
     74  UPDATE_CATCOMPRESS = NULL;
     75  if ((N = get_argument (*argc, argv, "-update-catcompress"))) {
     76    remove_argument (N, argc, argv);
     77    UPDATE_CATCOMPRESS = strcreate (argv[N]);
    6478    remove_argument (N, argc, argv);
    6579  }
     
    212226    remove_argument (N, argc, argv);
    213227  }
     228  UPDATE_CATCOMPRESS = NULL;
     229  if ((N = get_argument (*argc, argv, "-update-catcompress"))) {
     230    remove_argument (N, argc, argv);
     231    UPDATE_CATCOMPRESS = strcreate (argv[N]);
     232    remove_argument (N, argc, argv);
     233  }
    214234
    215235  /* replace measurement, don't duplicate */
  • trunk/Ohana/src/dvomerge/src/dvo_image_merge_dbs.c

    r37807 r38441  
    1616  short  *TgtCodes;
    1717 
    18   imagesSrc = gfits_table_get_Image (&src[0].ftable, &NimagesSrc, &src[0].swapped);
     18  imagesSrc = gfits_table_get_Image (&src[0].ftable, &NimagesSrc, &src[0].scaledValue, &src[0].nativeOrder);
    1919  if (!imagesSrc) {
    2020    fprintf (stderr, "ERROR: failed to read images from src\n");
     
    2222  }
    2323
    24   imagesTgt = gfits_table_get_Image (&tgt[0].ftable, &NimagesTgt, &tgt[0].swapped);
     24  imagesTgt = gfits_table_get_Image (&tgt[0].ftable, &NimagesTgt, &tgt[0].scaledValue, &tgt[0].nativeOrder);
    2525  if (!imagesTgt) {
    2626    fprintf (stderr, "ERROR: failed to read images from tgt\n");
     
    8383  }
    8484
    85   images = gfits_table_get_Image (&in[0].ftable, &Nimages, &in[0].swapped);
     85  images = gfits_table_get_Image (&in[0].ftable, &Nimages, &in[0].scaledValue, &in[0].nativeOrder);
    8686  if (!images) {
    8787    fprintf (stderr, "ERROR: failed to read images\n");
  • trunk/Ohana/src/dvomerge/src/dvoconvert.c

    r33657 r38441  
    8282
    8383      // skip empty input catalogs
    84       if (!incatalog.Naves_disk) {
     84      if (!incatalog.Naverage_disk) {
    8585        dvo_catalog_unlock (&incatalog);
    8686        dvo_catalog_free (&incatalog);
     
    9393    SkyListFree (inlist);
    9494
    95     outcatalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
     95    outcatalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT;
    9696    dvo_catalog_save (&outcatalog, VERBOSE);
    9797    dvo_catalog_unlock (&outcatalog);
     
    122122  /*** load output/Images.dat ***/
    123123  sprintf (ImageCat, "%s/Images.dat", output);
     124  gfits_db_init (&outDB);
    124125  outDB.mode   = dvo_catalog_catmode (CATMODE);
    125126  outDB.format = dvo_catalog_catformat (CATFORMAT);
     
    135136  /*** load input/Images.dat ***/
    136137  sprintf (ImageCat, "%s/Images.dat", input);
     138  gfits_db_init (&inDB);
    137139  // inDB.mode   = dvo_catalog_catmode (CATMODE);
    138140  // inDB.format = dvo_catalog_catformat (CATFORMAT);
     
    149151
    150152  // convert the raw image table to Image type (byteswap if needed)
    151   images = gfits_table_get_Image (&inDB.ftable, &Nimages, &inDB.swapped);
     153  images = gfits_table_get_Image (&inDB.ftable, &Nimages, &inDB.scaledValue, &inDB.nativeOrder);
    152154  if (!images) {
    153155    fprintf (stderr, "ERROR: failed to read images\n");
  • trunk/Ohana/src/dvomerge/src/dvomergeContinue.c

    r37116 r38441  
    109109    LoadCatalog (&incatalog, &inlist[0].regions[i][0], inlist[0].filename[i], "r", NsecfiltInput);
    110110    // skip empty input catalogs
    111     if (!incatalog.Naves_disk) {
     111    if (!incatalog.Naverage_disk) {
    112112        dvo_catalog_unlock (&incatalog);
    113113        dvo_catalog_free (&incatalog);
  • trunk/Ohana/src/dvomerge/src/dvomergeContinue_threaded.c

    r37116 r38441  
    4747    LoadCatalog (&incatalog, threadData->region, threadData->filename, "r", threadData->NsecfiltInput);
    4848    // skip empty input catalogs
    49     if (!incatalog.Naves_disk) {
     49    if (!incatalog.Naverage_disk) {
    5050      dvo_catalog_unlock (&incatalog);
    5151      dvo_catalog_free (&incatalog);
  • trunk/Ohana/src/dvomerge/src/dvomergeCreate.c

    r37116 r38441  
    145145
    146146      // skip empty input catalogs
    147       if (!incatalog.Naves_disk) {
     147      if (!incatalog.Naverage_disk) {
    148148        dvo_catalog_unlock (&incatalog);
    149149        dvo_catalog_free (&incatalog);
     
    166166
    167167      // skip empty input catalogs
    168       if (!incatalog.Naves_disk) {
     168      if (!incatalog.Naverage_disk) {
    169169        dvo_catalog_unlock (&incatalog);
    170170        dvo_catalog_free (&incatalog);
     
    204204    /*** load output/Images.dat ***/
    205205    sprintf (ImageCat, "%s/Images.dat", output);
     206    gfits_db_init (&outDB);
    206207    outDB.mode   = dvo_catalog_catmode (CATMODE);
    207208    outDB.format = dvo_catalog_catformat (CATFORMAT);
     
    218219    /*** load input1/Images.dat ***/
    219220    sprintf (ImageCat, "%s/Images.dat", input1);
     221    gfits_db_init (&in1DB);
    220222    in1DB.mode   = dvo_catalog_catmode (CATMODE);
    221223    in1DB.format = dvo_catalog_catformat (CATFORMAT);
     
    237239    /*** load input2/Images.dat ***/
    238240    sprintf (ImageCat, "%s/Images.dat", input2);
     241    gfits_db_init (&in2DB);
    239242    in2DB.mode   = dvo_catalog_catmode (CATMODE);
    240243    in2DB.format = dvo_catalog_catformat (CATFORMAT);
  • trunk/Ohana/src/dvomerge/src/dvomergeFromList.c

    r37116 r38441  
    113113
    114114    // skip empty input catalogs
    115     if (!incatalog.Naves_disk) {
     115    if (!incatalog.Naverage_disk) {
    116116        dvo_catalog_unlock (&incatalog);
    117117        dvo_catalog_free (&incatalog);
  • trunk/Ohana/src/dvomerge/src/dvomergeImageIDs.c

    r36833 r38441  
    1010  /*** load input1/Images.dat ***/
    1111  sprintf (ImageCat, "%s/Images.dat", input);
     12  gfits_db_init (&inDB);
    1213  inDB.mode   = dvo_catalog_catmode (CATMODE);
    1314  inDB.format = dvo_catalog_catformat (CATFORMAT);
    14   status       = dvo_image_lock (&inDB, ImageCat, 3600.0, LCK_SOFT);  // shorter timeout?
     15  status      = dvo_image_lock (&inDB, ImageCat, 3600.0, LCK_SOFT);  // shorter timeout?
    1516  if (!status) Shutdown ("ERROR: failure to lock image catalog %s", inDB.filename);
    1617
     
    3738  /*** load output/Images.dat ***/
    3839  sprintf (ImageCat, "%s/Images.dat", output);
     40  gfits_db_init (&outDB);
    3941  outDB.mode   = dvo_catalog_catmode (CATMODE);
    4042  outDB.format = dvo_catalog_catformat (CATFORMAT);
     
    9395  /*** load input1/Images.dat ***/
    9496  sprintf (ImageCat, "%s/Images.dat", input);
     97  gfits_db_init (&inDB);
    9598  inDB.mode   = dvo_catalog_catmode (CATMODE);
    9699  inDB.format = dvo_catalog_catformat (CATFORMAT);
    97   status       = dvo_image_lock (&inDB, ImageCat, 5400.0, LCK_XCLD);  // shorter timeout?
     100  status      = dvo_image_lock (&inDB, ImageCat, 5400.0, LCK_XCLD);  // shorter timeout?
    98101  if (!status) Shutdown ("ERROR: failure to lock image catalog %s", inDB.filename);
    99102
     
    115118  /*** load output/Images.dat ***/
    116119  sprintf (ImageCat, "%s/Images.dat", output);
     120  gfits_db_init (&outDB);
    117121  outDB.mode   = dvo_catalog_catmode (CATMODE);
    118122  outDB.format = dvo_catalog_catformat (CATFORMAT);
  • trunk/Ohana/src/dvomerge/src/dvomergeUpdate_catalogs.c

    r38062 r38441  
    142142
    143143    // skip empty input catalogs
    144     if (!incatalog.Naves_disk) {
     144    if (!incatalog.Naverage_disk) {
    145145        dvo_catalog_unlock (&incatalog);
    146146        dvo_catalog_free (&incatalog);
     
    176176
    177177      // if no catalog already exists, use the input catalog to define the format or the specified format
    178       if (outcatalog.Naves_disk == 0) {
    179         if (UPDATE_CATFORMAT) {
    180           outcatalog.catformat = dvo_catalog_catformat (UPDATE_CATFORMAT);
    181         } else {
    182           outcatalog.catformat = incatalog.catformat;
    183         }
     178      if (UPDATE_CATFORMAT) {
     179        outcatalog.catformat = dvo_catalog_catformat (UPDATE_CATFORMAT);
     180      } else {
     181        outcatalog.catformat = incatalog.catformat;
     182      }
     183      if (UPDATE_CATCOMPRESS) {
     184        outcatalog.catcompress = dvo_catalog_catcompress (UPDATE_CATCOMPRESS);
     185      } else {
     186        outcatalog.catcompress = incatalog.catcompress;
    184187      }
    185188
     
    227230  return TRUE;
    228231}
     232
     233int dvomergeUpdate_parallel_group (HostTableGroup *group, char *absinput, char *absoutput);
    229234
    230235// launch the dvomergeUpdate_client jobs to the parallel hosts
     
    254259  }   
    255260
     261  int Ngroups;
     262  HostTableGroup *groups = HostTableGroupsMaxNumber (table, &Ngroups, MAX_CLIENTS);
     263  // split the table into Ngroups, each with a unique set of machines (this avoids overloading the remote host machines)
     264
    256265  int i;
    257   for (i = 0; i < table->Nhosts; i++) {
     266  for (i = 0; i < Ngroups; i++) {
     267    // update only a max of MaxClient machines at a time
     268    dvomergeUpdate_parallel_group (&groups[i], absinput, absoutput);
     269  }
     270  return TRUE;
     271}
     272
     273int dvomergeUpdate_parallel_group (HostTableGroup *group, char *absinput, char *absoutput) {
     274
     275  int i;
     276  for (i = 0; i < group->Nhosts; i++) {
    258277
    259278    // ensure that the paths are absolute path names
    260     char *tmppath = abspath (table->hosts[i].pathname, DVO_MAX_PATH);
    261     free (table->hosts[i].pathname);
    262     table->hosts[i].pathname = tmppath;
     279    char *tmppath = abspath (group->hosts[i][0].pathname, DVO_MAX_PATH);
     280    free (group->hosts[i][0].pathname);
     281    group->hosts[i][0].pathname = tmppath;
    263282
    264283    // options / arguments that can affect relastro_client -update-objects:
    265284    char command[DVO_MAX_PATH];
    266285    snprintf (command, DVO_MAX_PATH, "dvomerge_client %s into %s -hostID %d -hostdir %s -region %f %f %f %f -D ADDSTAR_RADIUS %f",
    267               absinput, absoutput, table->hosts[i].hostID, table->hosts[i].pathname,
     286              absinput, absoutput, group->hosts[i][0].hostID, group->hosts[i][0].pathname,
    268287              UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, RADIUS
    269288      );
     
    291310      int status = system (command);
    292311      if (status) {
    293         fprintf (stderr, "ERROR running photdbc_client\n");
     312        fprintf (stderr, "ERROR running dvomerge_client\n");
    294313        exit (2);
    295314      }
     
    297316      // launch the job on the remote machine (no handshake)
    298317      int errorInfo = 0;
    299       int pid = rconnect ("ssh", table->hosts[i].hostname, command, table->hosts[i].stdio, &errorInfo, FALSE);
     318      int pid = rconnect ("ssh", group->hosts[i][0].hostname, command, group->hosts[i][0].stdio, &errorInfo, FALSE);
    300319      if (!pid) {
    301         if (DEBUG) fprintf (stderr, "failure to start %s (error %d)\n", table->hosts[i].hostname, errorInfo);
     320        if (DEBUG) fprintf (stderr, "failure to start %s (error %d)\n", group->hosts[i][0].hostname, errorInfo);
    302321        exit (1);
    303322      }
    304       table->hosts[i].pid = pid; // save for future reference
     323      group->hosts[i][0].pid = pid; // save for future reference
    305324    }
    306325  }
    307326
    308327  if (PARALLEL_MANUAL) {
    309     fprintf (stderr, "run the photdbc_client commands above.  when these are done, hit return\n");
     328    fprintf (stderr, "run the dvomerge_client commands above.  when these are done, hit return\n");
    310329    getchar();
    311330  }
    312331  if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) {
    313     int status = HostTableWaitJobsGetIO (table, __FILE__, __LINE__, VERBOSE);
     332    int status = HostTableGroupWaitJobsGetIO (group, __FILE__, __LINE__, VERBOSE);
    314333    if (!status) {
    315334      fprintf (stderr, "error running one of the remote clients\n");
  • trunk/Ohana/src/dvomerge/src/dvomergeUpdate_threaded.c

    r37116 r38441  
    4444    LoadCatalog (&incatalog, threadData->region, threadData->filename, "r", threadData->NsecfiltInput);
    4545    // skip empty input catalogs
    46     if (!incatalog.Naves_disk) {
     46    if (!incatalog.Naverage_disk) {
    4747      dvo_catalog_unlock (&incatalog);
    4848      dvo_catalog_free (&incatalog);
  • trunk/Ohana/src/dvomerge/src/dvorepairCPT.c

    r37807 r38441  
    7676  }
    7777
    78   measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat);
     78  measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat, FALSE);
    7979  myAssert(measure, "failed to convert ftable to measure data");
    8080
     
    156156  gfits_modify_alt (&cptHeaderPHU, "SORTED", "%t",      1,  FALSE);
    157157
     158  myAbort ("test for compression");
     159
    158160  /* convert internal to external format */
    159   if (!AverageToFtable (&cptFtable, average, Naverage, catformat, NULL)) {
     161  if (!AverageToFtable (&cptFtable, average, Naverage, catformat, NULL, TRUE)) {
    160162    myAbort("trouble converting format");
    161163  }
  • trunk/Ohana/src/dvomerge/src/dvorepairDeleteImageList.c

    r37807 r38441  
    4646  FILE *cpmFile = NULL;
    4747
    48   char catformat;
     48  DVOCatFormat catformat;
    4949
    5050  N = get_argument (argc, argv, "-delete-image-list");
     
    246246        gfits_scan(&cpmHeaderTBL, "NAXIS1", "%d", 1, &NbytesPerRow);
    247247
    248         measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat);
     248        measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat, FALSE);
    249249        myAssert(measure, "failed to convert ftable to measure data");
    250250   
     
    284284
    285285        // convert internal to external format
    286         if (!MeasureToFtable (&cpmFtable, NULL, measureNew, NmeasureNew, catformat)) {
     286        if (!MeasureToFtable (&cpmFtable, NULL, measureNew, NmeasureNew, catformat, TRUE)) {
    287287          myAbort("trouble converting format");
    288288        }
     
    467467  gfits_scan (&cptHeaderPHU, "NSECFILT",     "%d",      1,  &Nsecfilt);
    468468
     469  myAbort ("test for compression");
     470
    469471  /* convert internal to external format */
    470   if (!AverageToFtable (&cptFtable, averageOut, NaverageOut, catformat, NULL)) {
     472  if (!AverageToFtable (&cptFtable, averageOut, NaverageOut, catformat, NULL, TRUE)) {
    471473    myAbort("trouble converting format");
    472474  }
     
    529531
    530532    /* convert internal to external format */
    531     if (!SecFiltToFtable (&cpsFtable, secfilt, Nrows, catformat)) {
     533    if (!SecFiltToFtable (&cpsFtable, secfilt, Nrows, catformat, TRUE)) {
    532534      myAbort("trouble converting format");
    533535    }
  • trunk/Ohana/src/dvomerge/src/dvorepairDeleteImagesByExternID.c

    r37807 r38441  
    3838  char *imageFilename = NULL;
    3939
    40   char catformat;
     40  DVOCatFormat catformat;
    4141
    4242  N = get_argument (argc, argv, "-delete-images-by-extern-id");
     
    279279        gfits_scan(&cpmHeaderTBL, "NAXIS1", "%d", 1, &NbytesPerRow);
    280280
     281        myAbort ("fix compression");
     282
    281283        // this function can only handle PS1_V5 and later formats
    282284        // NOTE: FtableToMeasure (and equivalent) free the data associated with cpmFtable.
    283285        // We are left with the data in measure.
    284         measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat);
     286        measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat, FALSE);
    285287        myAssert(measure, "failed to convert ftable to measure data");
    286288   
     
    331333
    332334        // convert internal to external format
    333         if (!MeasureToFtable (&cpmFtable, NULL, measureNew, NmeasureNew, catformat)) {
     335        if (!MeasureToFtable (&cpmFtable, NULL, measureNew, NmeasureNew, catformat, TRUE)) {
    334336          myAbort("trouble converting format");
    335337        }
     
    493495
    494496  /* setup image table format and lock */
     497  gfits_db_init (&db);
    495498  db.mode    = dvo_catalog_catmode ("SPLIT");
    496499  db.format  = dvo_catalog_catformat ("PS1_V5");
     
    658661  gfits_scan (&cptHeaderPHU, "NSECFILT",     "%d",      1,  &Nsecfilt);
    659662
     663  myAbort ("test for compression");
     664
    660665  /* convert internal to external format */
    661   if (!AverageToFtable (&cptFtable, averageOut, NaverageOut, catformat, NULL)) {
     666  if (!AverageToFtable (&cptFtable, averageOut, NaverageOut, catformat, NULL, TRUE)) {
    662667    myAbort("trouble converting format");
    663668  }
     
    727732
    728733    /* convert internal to external format */
    729     if (!SecFiltToFtable (&cpsFtable, secfilt, Nrows, catformat)) {
     734    if (!SecFiltToFtable (&cpsFtable, secfilt, Nrows, catformat, TRUE)) {
    730735      myAbort("trouble converting format");
    731736    }
  • trunk/Ohana/src/dvomerge/src/dvorepairFixCPT.c

    r37046 r38441  
    8686  Matrix matrix;
    8787
    88   char catformat;
     88  DVOCatFormat catformat;
    8989
    9090  cpmFtable.header = &cpmHeaderTBL;
     
    120120  }
    121121
    122   measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat);
     122  myAbort ("fix cpts");
     123  measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat, FALSE);
    123124  myAssert(measure, "failed to convert ftable to measure data");
    124125
     
    127128
    128129  // convert internal to external format
    129   if (!MeasureToFtable (&cpmFtable, NULL, measure, Nmeasure, catformat)) {
     130  if (!MeasureToFtable (&cpmFtable, NULL, measure, Nmeasure, catformat, TRUE)) {
    130131    myAbort("trouble converting format");
    131132  }
  • trunk/Ohana/src/dvomerge/src/dvorepairFixImages.c

    r37807 r38441  
    255255
    256256  /* setup image table format and lock */
     257  gfits_db_init (oldDB);
    257258  db.mode   = oldDB->mode;
    258259  db.format = oldDB->format;
     
    280281  memset (&db.ftable.buffer[Nx*Nout], ' ', nbytes - Nx*Nout);
    281282
    282   db.swapped = TRUE; // internal representation
     283  db.nativeOrder = TRUE; // internal representation
     284  db.scaledValue = TRUE; // internal representation
    283285
    284286  gfits_modify (&db.header, "NIMAGES", OFF_T_FMT, 1,  Nout);
  • trunk/Ohana/src/dvomerge/src/dvorepairFixTables.c

    r37807 r38441  
    103103
    104104      // convert internal to external format
    105       if (!MeasureToFtable (&cpmFtable, NULL, measureNew, NmeasureNew, catformat)) {
     105      if (!MeasureToFtable (&cpmFtable, NULL, measureNew, NmeasureNew, catformat, TRUE)) {
    106106        myAbort("trouble converting format");
    107107      }
     
    183183  gfits_scan(&cpmHeaderTBL, "NAXIS2", "%d", 1, &Nrows);
    184184
    185   measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat);
     185  measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat, FALSE);
    186186  myAssert(measure, "failed to convert ftable to measure data");
    187187   
     
    326326  gfits_scan (&cptHeaderPHU, "NSECFILT",     "%d",      1,  &Nsecfilt);
    327327
     328  myAbort ("test for compression");
     329
    328330  /* convert internal to external format */
    329   if (!AverageToFtable (&cptFtable, averageOut, NaverageOut, catformat, NULL)) {
     331  if (!AverageToFtable (&cptFtable, averageOut, NaverageOut, catformat, NULL, TRUE)) {
    330332    myAbort("trouble converting format");
    331333  }
     
    388390
    389391    /* convert internal to external format */
    390     if (!SecFiltToFtable (&cpsFtable, secfilt, Nrows, catformat)) {
     392    if (!SecFiltToFtable (&cpsFtable, secfilt, Nrows, catformat, TRUE)) {
    391393      myAbort("trouble converting format");
    392394    }
  • trunk/Ohana/src/dvomerge/src/dvorepairImageVsMeasure.c

    r37046 r38441  
    128128      gfits_scan(&cpmHeaderTBL, "NAXIS1", "%d", 1, &NbytesPerRow);
    129129
    130       measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat);
     130      measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat, FALSE);
    131131      myAssert(measure, "failed to convert ftable to measure data");
    132132   
  • trunk/Ohana/src/dvomerge/src/dvorepairImagesVsMeasures.c

    r37046 r38441  
    3232  FILE *cpmFile = NULL;
    3333
    34   char catformat;
     34  DVOCatFormat catformat;
    3535
    3636  N = get_argument (argc, argv, "-images-vs-measures");
     
    134134      gfits_scan(&cpmHeaderTBL, "NAXIS1", "%d", 1, &NbytesPerRow);
    135135
    136       measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat);
     136      measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat, FALSE);
    137137      myAssert(measure, "failed to convert ftable to measure data");
    138138   
  • trunk/Ohana/src/dvomerge/src/dvosecfilt_catalogs.c

    r35416 r38441  
    3939    // always load all of the data (if any exists)
    4040    catalog.Nsecfilt  = 0;
    41     catalog.catflags  = LOAD_SECF;  // XXX this will fail for MEF version
     41    catalog.catflags  = DVO_LOAD_SECFILT;  // XXX this will fail for MEF version
    4242    catalog.catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
    4343    catalog.catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
     
    4848    }
    4949
    50     if (catalog.Naves_disk == 0) {
     50    if (catalog.Naverage_disk == 0) {
    5151      dvo_catalog_unlock (&catalog);
    5252      dvo_catalog_free (&catalog);
     
    6464
    6565    insec = catalog.secfilt;
    66     ALLOCATE (outsec, SecFilt, catalog.Naves_disk * Nsecfilt);
     66    ALLOCATE (outsec, SecFilt, catalog.Naverage_disk * Nsecfilt);
    6767
    68     for (k = 0; k < catalog.Naves_disk; k++) {
     68    for (k = 0; k < catalog.Naverage_disk; k++) {
    6969      for (j = 0; (j < catalog.Nsecfilt) && (j < Nsecfilt); j++) {
    7070        outsec[k*Nsecfilt + j] = insec[k*NsecInput + j];
     
    7777    catalog.secfilt = outsec;
    7878    catalog.Nsecfilt = Nsecfilt;
    79     catalog.Nsecf_mem = Nsecfilt * catalog.Naves_disk;
    80     catalog.Nsecf_disk = Nsecfilt * catalog.Naves_disk;
     79    catalog.Nsecfilt_mem = Nsecfilt * catalog.Naverage_disk;
     80    catalog.Nsecfilt_disk = Nsecfilt * catalog.Naverage_disk;
    8181
    8282    dvo_catalog_save (&catalog, VERBOSE);
  • trunk/Ohana/src/dvomerge/src/dvoutils_load_image_index.c

    r37807 r38441  
    8787
    8888  off_t Nimage;
    89   Image *image = gfits_table_get_Image (&db.ftable, &Nimage, &db.swapped);
     89  Image *image = gfits_table_get_Image (&db.ftable, &Nimage, &db.scaledValue, &db.nativeOrder);
    9090  if (!image) {
    9191    fprintf (stderr, "ERROR: failed to read images\n");
  • trunk/Ohana/src/dvomerge/src/dvoutils_uniq_images.c

    r37807 r38441  
    132132      }
    133133      IDlist[n] ++;
     134      if (VERBOSE && (IDlist[n] > 1)) {
     135        fprintf (stderr, "duplicate ext_id %d in file %s\n", extern_id[i], imFile);
     136      }
    134137    }
    135138
  • trunk/Ohana/src/dvomerge/src/dvoverify_utils.c

    r37807 r38441  
    178178  catalog.catformat = DVO_FORMAT_UNDEF; // read-only,do not set the catformat
    179179  catalog.catmode   = DVO_MODE_UNDEF; // read-only, do not set the catmode
    180   catalog.catflags  = LOAD_AVES | LOAD_MEAS | LOAD_LENSING | LOAD_LENSOBJ;
     180  catalog.catflags  = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_LENSING | DVO_LOAD_LENSOBJ;
    181181  catalog.Nsecfilt  = 0;
    182182 
     
    187187  }
    188188
    189   // Naves_disk == 0 implies an empty catalog file, skip empty catalogs
    190   if (catalog.Naves_disk == 0) {
     189  // Naverage_disk == 0 implies an empty catalog file, skip empty catalogs
     190  if (catalog.Naverage_disk == 0) {
    191191    dvo_catalog_unlock (&catalog);
    192192    dvo_catalog_free (&catalog);
     
    467467
    468468  // load the iage database table
     469  gfits_db_init (&inDB);
    469470  status = dvo_image_lock (&inDB, ImageCat, 3600.0, LCK_SOFT);  // shorter timeout?
    470471  if (!status) {
     
    484485  }
    485486
    486   images = gfits_table_get_Image (&inDB.ftable, &Nimages, &inDB.swapped);
     487  images = gfits_table_get_Image (&inDB.ftable, &Nimages, &inDB.scaledValue, &inDB.nativeOrder);
    487488  if (!images) {
    488489    fprintf (stderr, "ERROR: failed to read images from src\n");
  • trunk/Ohana/src/dvomerge/src/merge_catalogs.c

    r27435 r38441  
    5757  output[0].Naverage = Naverage;
    5858  output[0].Nmeasure = Nmeasure;
    59   output[0].Nsecf_mem = Naverage * Nsecfilt;
     59  output[0].Nsecfilt_mem = Naverage * Nsecfilt;
    6060 
    6161  if (VERBOSE) {
  • trunk/Ohana/src/dvomerge/src/merge_catalogs_new.c

    r37814 r38441  
    115115  output[0].Nlensing = Nlensing;
    116116  output[0].Nstarpar = Nstarpar;
    117   output[0].Nsecf_mem = Naverage * NsecfiltOut;
     117  output[0].Nsecfilt_mem = Naverage * NsecfiltOut;
    118118
    119119  // If we are using dvomergeCreate to split an existing catalog, then the max objID in
  • trunk/Ohana/src/dvomerge/src/merge_catalogs_old.c

    r37807 r38441  
    112112
    113113  /* set up pointers for linked list of measure */
    114   if (output[0].sorted && (output[0].Nmeasure >= output[0].Nmeas_disk)) {
     114  if (output[0].sorted && (output[0].Nmeasure >= output[0].Nmeasure_disk)) {
    115115    // this version is only valid if we have done a full catalog load, and if the catalog
    116116    // is sorted while processed
     
    504504  output[0].Nlensing = Nlens;
    505505  output[0].Nstarpar = Nstar;
    506   output[0].Nsecf_mem = Nave*NsecfiltOut;
     506  output[0].Nsecfilt_mem = Nave*NsecfiltOut;
    507507  if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas, Nlens: "OFF_T_FMT" "OFF_T_FMT" "OFF_T_FMT" "OFF_T_FMT", ("OFF_T_FMT" matches)\n",  Nstars,  Nave,  Nmeas,  Nlens, Nmatch);
    508508
Note: See TracChangeset for help on using the changeset viewer.