IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 20, 2006, 5:36:41 PM (20 years ago)
Author:
eugene
Message:

updated to the new DVO APIs; minor cleanups (unused variables, etc)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/dvo/avextract.c

    r7917 r8427  
    5454  if ((vec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) goto escape;
    5555
     56  // XXX need to add interrupt test to this loop
    5657  for (i = 0; i < skylist[0].Nregions; i++) {
    5758    /* lock, load, unlock catalog */
    5859    catalog.filename = skylist[0].filename[i];
    59     switch (lock_catalog (&catalog, LCK_SOFT)) {
    60     case 2:
    61       unlock_catalog (&catalog);
    62     case 0:
    63       continue;
     60    catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
     61
     62    // an error exit status here is a significant error
     63    if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
     64      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
     65      exit (2);
    6466    }
    65     catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
    66     if (!load_catalog (&catalog, FALSE)) {
    67       unlock_catalog (&catalog);
    68       continue;
    69     }
    70     unlock_catalog (&catalog);
     67    dvo_catalog_unlock (&catalog);
    7168
    7269    for (j = 0; j < catalog.Naverage; j++) {
     
    7673      CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 2000);
    7774    }
    78     if (catalog.average != NULL) free (catalog.average);
    79     if (catalog.secfilt != NULL) free (catalog.secfilt);
    80     if (catalog.measure != NULL) free (catalog.measure);
    81     catalog.average = (Average *) NULL;
    82     catalog.secfilt = (SecFilt *) NULL;
    83     catalog.measure = (Measure *) NULL;
     75    dvo_catalog_free (&catalog);
    8476  }
    8577  vec[0].Nelements = N;
     
    9587escape:
    9688  SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));
    97   if (catalog.average != NULL) free (catalog.average);
    98   if (catalog.secfilt != NULL) free (catalog.secfilt);
    99   if (catalog.measure != NULL) free (catalog.measure);
     89  dvo_catalog_free (&catalog);
    10090  if (RegionName != NULL) free (RegionName);
    10191  if (RegionList != NULL) free (RegionList);
Note: See TracChangeset for help on using the changeset viewer.