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/dmags.c

    r7917 r8427  
    5858    /* lock, load, unlock catalog */
    5959    catalog.filename = skylist[0].filename[j];
    60     switch (lock_catalog (&catalog, LCK_SOFT)) {
    61       case 2:
    62         unlock_catalog (&catalog);
    63       case 0:
    64         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);
    6566    }
    66     catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
    67     if (!load_catalog (&catalog, FALSE)) {
    68       unlock_catalog (&catalog);
    69       continue;
    70     }
    71     unlock_catalog (&catalog);
     67    dvo_catalog_unlock (&catalog);
    7268
    7369    /* get correct mags, convert to X,Y */
     
    108104      if (M3 != NULL) free (M3);
    109105    }
    110     if (catalog.average != NULL) free (catalog.average);
    111     if (catalog.secfilt != NULL) free (catalog.secfilt);
    112     if (catalog.measure != NULL) free (catalog.measure);
    113     catalog.average = (Average *) NULL;
    114     catalog.secfilt = (SecFilt *) NULL;
    115     catalog.measure = (Measure *) NULL;
     106    dvo_catalog_free (&catalog);
    116107  }
    117108
     
    131122escape:
    132123  SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));
    133   if (catalog.average != NULL) free (catalog.average);
    134   if (catalog.secfilt != NULL) free (catalog.secfilt);
    135   if (catalog.measure != NULL) free (catalog.measure);
     124  dvo_catalog_free (&catalog);
    136125  if (RegionName != NULL) free (RegionName);
    137126  if (RegionList != NULL) free (RegionList);
Note: See TracChangeset for help on using the changeset viewer.