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

    r7917 r8427  
    5959    /* lock, load, unlock catalog */
    6060    catalog.filename = skylist[0].filename[k];
    61     switch (lock_catalog (&catalog, LCK_SOFT)) {
    62       case 2:
    63         unlock_catalog (&catalog);
    64       case 0:
    65         continue;
     61    catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
     62
     63    // an error exit status here is a significant error
     64    if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
     65      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
     66      exit (2);
    6667    }
    67     catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
    68     if (!load_catalog (&catalog, FALSE)) {
    69       unlock_catalog (&catalog);
    70       continue;
    71     }
    72     unlock_catalog (&catalog);
     68    dvo_catalog_unlock (&catalog);
    7369
    7470    /* get correct mags, convert to X,Y */
     
    109105      if (M2 != NULL) free (M2);
    110106    }
    111     if (catalog.average != NULL) free (catalog.average);
    112     if (catalog.secfilt != NULL) free (catalog.secfilt);
    113     if (catalog.measure != NULL) free (catalog.measure);
    114     catalog.average = (Average *) NULL;
    115     catalog.secfilt = (SecFilt *) NULL;
    116     catalog.measure = (Measure *) NULL;
     107    dvo_catalog_free (&catalog);
    117108  }
    118109  SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));
     
    126117escape:
    127118  SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));
    128   if (catalog.average != NULL) free (catalog.average);
    129   if (catalog.secfilt != NULL) free (catalog.secfilt);
    130   if (catalog.measure != NULL) free (catalog.measure);
     119  dvo_catalog_free (&catalog);
    131120  if (RegionName != NULL) free (RegionName);
    132121  if (RegionList != NULL) free (RegionList);
Note: See TracChangeset for help on using the changeset viewer.