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

    r7917 r8427  
    6060    /* lock, load, unlock catalog */
    6161    catalog.filename = skylist[0].filename[k];
    62     switch (lock_catalog (&catalog, LCK_SOFT)) {
    63       case 2:
    64         unlock_catalog (&catalog);
    65       case 0:
    66         continue;
     62    catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
     63
     64    // an error exit status here is a significant error
     65    if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
     66      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
     67      exit (2);
    6768    }
    68     catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
    69     if (!load_catalog (&catalog, TRUE)) {
    70       unlock_catalog (&catalog);
    71       continue;
    72     }
    73     unlock_catalog (&catalog);
     69    dvo_catalog_unlock (&catalog);
     70
    7471    // gprint (GP_ERR, "seaching %s with %d stars\n", catalog.filename, catalog.Naverage);
    7572    // ListPhotSelections ();
     
    113110    }
    114111    // gprint (GP_ERR, "selected %d stars\n", Npts);
    115 
    116     if (catalog.average != NULL) free (catalog.average);
    117     if (catalog.secfilt != NULL) free (catalog.secfilt);
    118     if (catalog.measure != NULL) free (catalog.measure);
    119     catalog.average = (Average *) NULL;
    120     catalog.secfilt = (SecFilt *) NULL;
    121     catalog.measure = (Measure *) NULL;
     112    dvo_catalog_free (&catalog);
    122113  }
    123114  SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));
     
    130121escape:
    131122  SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));
    132   if (catalog.average != NULL) free (catalog.average);
    133   if (catalog.secfilt != NULL) free (catalog.secfilt);
    134   if (catalog.measure != NULL) free (catalog.measure);
     123  dvo_catalog_free (&catalog);
    135124  if (RegionName != NULL) free (RegionName);
    136125  if (RegionList != NULL) free (RegionList);
Note: See TracChangeset for help on using the changeset viewer.