IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8391


Ignore:
Timestamp:
Aug 16, 2006, 1:48:48 PM (20 years ago)
Author:
eugene
Message:

removing old versions, updating to new DVO APIs

Location:
trunk/Ohana/src/photdbc/src
Files:
9 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/photdbc/src/load_catalogs.c

    r4808 r8391  
    1313  for (i = 0; i < Nregion; i++) {
    1414    catalog[i].filename = region[i].filename;  /* don't free region before catalog! */
    15     switch (lock_catalog (&catalog[i], LCK_SOFT)) {
    16     case 0:
    17       fprintf (stderr, "ERROR: can't lock file %s\n", catalog[i].filename);
    18       exit (1);
    19     case 1:
    20       gcatalog (&catalog[i]); /* load from disk */
    21       break;
    22     case 2:
    23       if (VERBOSE) fprintf (stderr, "no data in %s, skipping\n", catalog[i].filename);
    24       catalog[i].Naverage = 0;
    25       catalog[i].Nmeasure = 0;
    26       break;
    27     default:
    28       fprintf (stderr, "weird lock_catalog exit state\n");
    29       exit (1);
     15    catalog[i].catmode  = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data
     16    catalog[i].filename = skylist[0].filename[i];
     17    catalog[i].Nsecfilt = GetPhotcodeNsecfilt ();
     18    catalog[i].catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;
     19    if (options.update) catalog[i].catflags = LOAD_AVES | LOAD_MEAS_META | LOAD_MISS | LOAD_SECF;
     20
     21    // an error exit status here is a significant error
     22    if (!dvo_catalog_open (&catalog[i], skylist[0].regions[i], VERBOSE, "w")) {
     23      fprintf (stderr, "ERROR: failure to open/create catalog file %s\n", catalog.filename);
     24      exit (2);
     25    }
     26    if (!catalog[i].Nave_disk) {
     27      dvo_catalog_unlock (&catalog[i]);
     28      dvo_catalog_free (&catalog[i]);
     29      continue;
    3030    }
    3131  }
  • trunk/Ohana/src/photdbc/src/photdbc.c

    r6238 r8391  
    3535  get_mags (catalog);
    3636
    37   unlock_catalog (catalog);
     37  // XXX this is all messed up: are we working on more than one region or not??
     38  for (i = 0; i < Nregion; i++) {
     39    // XXX empty catalogs are already unlocked and freed
     40    dvo_catalog_unlock (&catalog[i]);
     41    dvo_catalog_free (&catalog[i]);
     42  }
    3843
     44  // XXX?????
    3945  sprintf (filename, "newdir/%s", argv[1]);
    4046  catalog[0].filename = filename;
    4147
    4248  check_directory (catalog[0].filename);
    43   if (!lock_catalog (catalog, LCK_XCLD)) {
     49  if (!dvo_catalog_open (catalog, ...)) {
    4450    fprintf (stderr, "can't lock new catalog file %s\n", catalog[0].filename);
    4551    exit (1);
    4652  }
    47   wcatalog (catalog);
     53  dvo_catalog_save (catalog);
    4854  exit (0);
    4955}
Note: See TracChangeset for help on using the changeset viewer.